Emile is rigth, there should be a () there.
I'm sorry, im writing this from my cellphone and there's not a pc around XD.
I didn,t know about the csv module either and had to do over complicated things
to deal with embedded commas, thx for that too :).
--
Amin Rainmaker
--- Begin Message ---
S Python wrote:
f = open(r'C:\test.txt', 'r')
foo = f.readline.split(',')
readline is the function/method name
readline() executes that function/method and returns a value
try typing in 'type(f.readline)' vs 'type(f.readline())'
you can't .split() a function but you may split its return value.
but it fails when I try:
import csv
myfile = open(r'c:\test.txt', 'r')
data = csv.Reader(myfile, delimeter = ',')
Python is case sensitive -- reader is different from Reader.
HTH,
Emile
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
--- End Message ---
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor