use io package from writing csv
This commit is contained in:
parent
c4ceb3cdae
commit
e73fa0afa9
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import io
|
||||||
import imaplib
|
import imaplib
|
||||||
import os
|
import os
|
||||||
import email
|
import email
|
||||||
@ -177,10 +178,12 @@ class Participation(object):
|
|||||||
self.registration_date.isoformat(), self._role, str(self.fee), str(self.farewell_event),
|
self.registration_date.isoformat(), self._role, str(self.fee), str(self.farewell_event),
|
||||||
str(self.gwinner_award), str(self.labtour), str(self._food_vegi), str(self._food_vegan),
|
str(self.gwinner_award), str(self.labtour), str(self._food_vegi), str(self._food_vegan),
|
||||||
str(self._food_gluten), str(self._food_normal)]
|
str(self._food_gluten), str(self._food_normal)]
|
||||||
with open(filename, "w") as f:
|
|
||||||
f.write("; ".join(header))
|
with io.open(filename, mode="w", encoding="UTF8") as fd:
|
||||||
f.write("\n")
|
fd.write("; ".join(header))
|
||||||
f.write("; ".join(values))
|
fd.write("\n")
|
||||||
|
fd.write("; ".join(values))
|
||||||
|
|
||||||
return filename
|
return filename
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user