(Oct-12-2018, 12:58 AM)Larz60+ Wrote: open a text file:
with open('myfilename.txt', 'w') as fp:
for row in rows:
fp.write(row)
But the csv file is already a file, and can be used as any other text file.
I typed this
import csv
with open('animals3.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
with open('myfilename.txt, 'w') as fp:
for row in rows:
fp.write(row)
Error I got:
NameError:name 'rows' is not defined
Error:
[error]
[/error]
(Oct-12-2018, 01:25 AM)Bigjay45 Wrote: (Oct-12-2018, 12:58 AM)Larz60+ Wrote: open a text file:
with open('myfilename.txt', 'w') as fp:
for row in rows:
fp.write(row)
But the csv file is already a file, and can be used as any other text file.
I typed this
import csv
with open('animals3.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
with open('myfilename.txt, 'w') as fp:
for row in rows:
fp.write(row)
Error I got:
Error:
NameError:name 'rows' is not defined