1

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'])

enter image description here

nic
  • 11
  • 2

1 Answers1

1
with open('test.csv', 'w') as ofile:
    write = csv.writer(ofile)
    write.writerow(i for  i in ['1' ,'2' ,'3']) # 

Change wb to w Because you write numbers

  • 1
    Hi, unfortunately the charakters still end up in one cell. Thanks for the answer anyways :) – nic Nov 16 '22 at 07:04