-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm trying to solve this problem:

suppose I'm reading a csv file and want to create a tuple of all those
rows and values, like ((row1value1, row1value2, row1value3),(row2value1,
row2value2, row2value3),..., (rowNvalue1, rowNvalue2, rowNvalue3))

I haven't found the way to do it just using tuples.  How can I do it?

Nevertheless, I can solve it like this:
a=[]

for row in reader:
~   elem = (row[0],row[1],row[2])
~   a.append(elem)

which will result in a list of tuples: [(row1value1, row1value2,
row1value3),(row2value1, row2value2, row2value3),..., (rowNvalue1,
rowNvalue2, rowNvalue3)]

Then, I get what I want with tuple(a).



Luis P. Mendes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDIdcvHn4UHCY8rB8RAjBnAJ9hLzbMZVZf3vLZ0iCs2ptK0v6RPwCfRr1S
GHdoy/APTZSWy+rLBA+i0KE=
=vyR6
-----END PGP SIGNATURE-----
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to