Skip to content

Instantly share code, notes, and snippets.

@fitoria
Forked from josernestodavila/crear_csv.py
Created March 26, 2010 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitoria/344526 to your computer and use it in GitHub Desktop.
Save fitoria/344526 to your computer and use it in GitHub Desktop.
def email_to_csv(self, widget, data=None):
""" email_to_csv - Exports the e-mail registered in this month to a csv file"""
# FIXME: Agregar un FileChooserDialog para elegir donde guardar el archivo csv
results = self.database.execute_view("asistencia_mensual", "pizzabashlog")
f = open("emails.csv","w")
for result in results[[date.today().month]]:
# FIXME: Buscar una mejor manera de forzar el salto de línea en el archivo
f.writelines(result.value['email'] + '\n')
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment