[Tutor] CSV file processing...
Kent Johnson
kent37 at tds.net
Fri Mar 21 23:06:03 CET 2008
Marc Tompkins wrote:
> Sorry... no, it still shouldn't work...
> maybe like so:
> co.execute('''INSERT INTO stats
> VALUES("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s"
> % row''')
>
>
> You have triple quotes around your SQL. That means that "implied"
> line breaks become real. It won't look as nice, but take the line
> breaks out and I think it ought to work.
Wrong on both counts. The triple quotes and line breaks are fine and row
should be passed as a separate argument as it was.
Kent
More information about the Tutor
mailing list