Python Forum

Full Version: Write SQLite query result to file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to write a SQLite query result in a file:

c.execute("SELECT * FROM mytable ORDER BY date(Date) ASC LIMIT 1;")
f.write(c.fetchone())

but I get this error:

TypeError: argument 1 must be string or read-only character buffer, not None

how can I solve this?