J
Jiewei Huang
Hi all,
Currently create a simple text-based database of information about people
I have a csv file which consist of 3 rows , row 1 2 and 3 is as such:
Name Address Telephone Birthday
John Konon Ministry of Moon Walks 4567882 27-Feb
Stacy Kisha Ministry of Man Power 1234567 17-Jan
My codes are :
import csv
original = file('friends.csv', 'rU')
reader = csv.reader(original)
for row in reader:
print row
and the output is :
['Name', ' Address', 'Telephone', 'Birthday']
['John Konon', 'Ministry of Moon Walks', '4567882', '27-Feb']
['Stacy Kisha', 'Ministry of Man Power', '1234567', '17-Jan']
But i wanted to make it
[('John Cleese', 'Ministry of Silly Walks', '5555421', '27-Feb'),
( 'Stacy Kisha', 'Ministry of Man Power', '1234567', 17-Jan')]
can someone show me guidance to this issue
Thanks all
Currently create a simple text-based database of information about people
I have a csv file which consist of 3 rows , row 1 2 and 3 is as such:
Name Address Telephone Birthday
John Konon Ministry of Moon Walks 4567882 27-Feb
Stacy Kisha Ministry of Man Power 1234567 17-Jan
My codes are :
import csv
original = file('friends.csv', 'rU')
reader = csv.reader(original)
for row in reader:
print row
and the output is :
['Name', ' Address', 'Telephone', 'Birthday']
['John Konon', 'Ministry of Moon Walks', '4567882', '27-Feb']
['Stacy Kisha', 'Ministry of Man Power', '1234567', '17-Jan']
But i wanted to make it
[('John Cleese', 'Ministry of Silly Walks', '5555421', '27-Feb'),
( 'Stacy Kisha', 'Ministry of Man Power', '1234567', 17-Jan')]
can someone show me guidance to this issue
Thanks all