Old Nabble - Turbogears General - how to return csv data?

Old Nabble - Turbogears General - how to return csv data?: "e.g. like this

@expose(content_type='text/csv')
def csv(self):
stream = StringIO()
writer = csv.writer(stream, dialect='excel')
writer.writerow(['Spam'] * 5 + ['Baked Beans'])
writer.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
output = stream.getvalue()
stream.close()
return output

For creating real Excel files you can use this:

http://www.python-excel.org

- Sent using Google Toolbar"

Comments

Popular posts from this blog

How to use the Inbox Repair Tool to recover messages in Outlook 2000 that is installed with Internet Mail Only option

ReadyNAS default login and password

Repair corrupt Outlook PST files with two Microsoft utilities