CSV Example 1

employee.csv
==========


employee no employeename jobdescription salary
1 a cea 25000





 csvtest.py
=======
import csv
with open('employee.csv','rb') as f:
    reader=csv.reader(f)
    for row in reader:
        print row
       




 >>> import csvtest
['employee no', 'employeename', 'jobdescription', 'salary']
['1', 'a', 'cea', '25000']

No comments:

Post a Comment