Skip to content

Instantly share code, notes, and snippets.

@josernestodavila
Created March 26, 2010 04:32
Show Gist options
  • Save josernestodavila/344523 to your computer and use it in GitHub Desktop.
Save josernestodavila/344523 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