Re: [web2py] Re: Exporting a table to csv

2018-09-04 Thread Chris Insinger
Hi Dave, You’re right, I’m using python3. I thought it might be related to that so yesterday I added an issue on the github site for the book: https://github.com/web2py/web2py-book/issues/393 If that’s the wrong place/way please let me know. Regards, Chris Sent from my iPhone >> On 5 Sep 2

[web2py] Re: Exporting a table to csv

2018-09-04 Thread Dave S
On Monday, September 3, 2018 at 10:31:25 PM UTC-7, Chris_I wrote: > > Hi there, > > Found a way to solve it, and thought I'd share in case others search on > this topic. > > Replace the str(...) below with str(...).encode(), so that it looks like > this: > > open('test.csv', 'wb').write(str(db(db

[web2py] Re: Exporting a table to csv

2018-09-03 Thread Chris_I
Hi there, Found a way to solve it, and thought I'd share in case others search on this topic. Replace the str(...) below with str(...).encode(), so that it looks like this: open('test.csv', 'wb').write(str(db(db.student).select()).encode()) Regards, Chris On Monday, 3 September 2018 22:53