Not able to get a line by line outputs after writing values into CSV file since one of the value contains a comma
Code snippet:
with open('queryout.csv', 'w') as f:
f.write("%s\n" % header)
for key in values:
var_value = (str(key['count']) + "," + str(key['average']) + "," + str(key['example']))
f.write("%s\n" % var_value)
Count and average variables contains integer and example variable contains query like select id,hdh,dhd from table name where column.
Because of example contains a comma I am not able to see them as expected like CSV format while printing.
Could you please anyone help me out?
Thanks in advance