RE: Can json.dumps create multiple lines

2016-12-02 Thread Joaquin Alzola
On Thu, Dec 1, 2016 at 10:30 AM, Cecil Westerhof wrote: > I would prefer when it would generate: > '[ > "An array", > "with several strings", > "as a demo" > ]' > > Is this possible, or do I have to code this myself? >

Re: Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
On Thursday 1 Dec 2016 23:58 CET, Peter Otten wrote: > Cecil Westerhof wrote: > >> On Thursday 1 Dec 2016 22:52 CET, Cecil Westerhof wrote: >> >>> Now I need to convert the database. But that should not be a big >>> problem. >> >> I did the conversion with: >> cursor.execute('SELECT tipID FROM

Re: Can json.dumps create multiple lines

2016-12-01 Thread Peter Otten
Cecil Westerhof wrote: > On Thursday 1 Dec 2016 22:52 CET, Cecil Westerhof wrote: > >> Now I need to convert the database. But that should not be a big >> problem. > > I did the conversion with: > cursor.execute('SELECT tipID FROM tips') > ids = cursor.fetchall() > for id in ids: >

Re: Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
On Thursday 1 Dec 2016 22:52 CET, Cecil Westerhof wrote: > Now I need to convert the database. But that should not be a big > problem. I did the conversion with: cursor.execute('SELECT tipID FROM tips') ids = cursor.fetchall() for id in ids: id = id[0]

Re: Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
On Thursday 1 Dec 2016 17:55 CET, Zachary Ware wrote: > On Thu, Dec 1, 2016 at 10:30 AM, Cecil Westerhof wrote: >> I would prefer when it would generate: >> '[ >> "An array", >> "with several strings", >> "as a demo" >> ]' >> >> Is this possible, or do I have to code this

Re: Can json.dumps create multiple lines

2016-12-01 Thread Tim Chase
On 2016-12-01 17:30, Cecil Westerhof wrote: > When I have a value dummy which contains: > ['An array', 'with several strings', 'as a demo'] > Then json.dumps(dummy) would generate: > '["An array", "with several strings", "as a demo"]' > I would prefer when it would generate: > '[ >

Re: Can json.dumps create multiple lines

2016-12-01 Thread John Gordon
In <87lgvz4no8@equus.decebal.nl> Cecil Westerhof writes: > I started to use json.dumps to put things in a SQLite database. But I > think it would be handy when it would be easy to change the values > manually. > When I have a value dummy which contains: > ['An array',

Re: Can json.dumps create multiple lines

2016-12-01 Thread Zachary Ware
On Thu, Dec 1, 2016 at 10:30 AM, Cecil Westerhof wrote: > I would prefer when it would generate: > '[ > "An array", > "with several strings", > "as a demo" > ]' > > Is this possible, or do I have to code this myself?