Reputation: 11
I am trying to export data from Ansys Mechanical by writing into a csv file. Unfortunately with my code the charakters in my lists don´t get seperated by the comma. They just end up in one cell and I can't figure out why. Thanks allot
Here are an example of my code and results
import csv
csv_outfile = r'Z:\Ansys\05-11-2022_output.csv'
with open(csv_outfile, 'wb') as ofile:
write = csv.writer(ofile)
write.writerow(['1' ,'2' ,'3'])
Upvotes: 1
Views: 694
Reputation: 475
with open('test.csv', 'w') as ofile:
write = csv.writer(ofile)
write.writerow(i for i in ['1' ,'2' ,'3']) #
Upvotes: 1