Reading a csv from excel is not a the same Excel file formats.
Excel can read and output text file formats as txt,csv ect...
If have csv file can read it as normal file or use csv module.
Excel can read and output text file formats as txt,csv ect...
If have csv file can read it as normal file or use csv module.
data.csv:
Output:Year,Make,Model,Length
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38
import csv with open('data.csv') as f: data = csv.reader(f, delimiter=',') for row in data: print(row)
Output:['Year', 'Make', 'Model', 'Length']
['1997', 'Ford', 'E350', '2.34']
['2000', 'Mercury', 'Cougar', '2.38']
Quote:Ok thank you, let me check. And can I pass the file object as an argument for the other function and access the file contents in the other function? Is it possible?? If so,please give me a articles to move forward.That's no problem,you most explain better what you want do.