You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python script to generate CSV file for importing notes
importcsv# This is fixed like the CSV templatefieldnames= ['title', 'image', 'content', 'type', 'op1', 'op2', 'op3', 'op4', 'op5', 'correct_op', 'explain']
# Sample data, you can replace it with any iterator data= [
["In the Scoville scale, what is the hottest chemical?", "Resiniferatoxin"],
["Dry ice is the solid form of what substance?", "Carbon dioxide"],
]
withopen('notes.csv', 'w', newline='') ascsvfile:
writer=csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
forrowindata:
# Row data will depends on the note typewriter.writerow({
'title': row[0],
'type': "Flash card", # "Multiple choice", "Type answer" or "Flash card"'explain': row[2],
})