How do I write data to a file that I have taken from an SQL database in Python? (sqlite3) -


  c.execute ("select * where from the student's forename =: first and last name =: alias and Year group =: "group", "start": formdumber, "enddate": startdate, "enddate": enddate}} StudentRequest = c.fetchall () record = studentRequest # to write the file = write open ('student report ',' W ') f.write (name) f.write (' form number: '+ (year group +' / '+ formnumber) f.write (str (record)) f.close ()  

This is my code, but this file does not seem to be writing data from the database. Name, forum number etc.

Can anyone help?

Does your output contain "[]"? It looks like there is no match in your query.

If it is not, create an example to show the problem.


Comments