Re: read file problem

2006-02-06 Thread Ernesto
Thanks to all. -- http://mail.python.org/mailman/listinfo/python-list

Re: read file problem

2006-02-06 Thread Schüle Daniel
if you want the numbers you can combine it into one-liner nums = file(r"C:\folder\myFile.txt").read().split(";") the numbers are in string representation in the list you can no do nums = [float(num) for num in nums] Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: read file problem

2006-02-06 Thread Rene Pijlman
Ernesto: >fileHandle = open(filePath, 'r').read(); Remove this: open() returns the filehandle, open().read() returns the data read from the filehandle. -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: read file problem

2006-02-06 Thread Fuzzyman
Ernesto wrote: > I'm just want to read in the contents of a (text) file. The text file > is filled with semiColon delimited floating point strings... > > 0.456;1.265;99.742;... > > For some reason, I can't get the contents back when I call file.read() > Here's my code. > > filePath = "C:\\folder

read file problem

2006-02-06 Thread Ernesto
I'm just want to read in the contents of a (text) file. The text file is filled with semiColon delimited floating point strings... 0.456;1.265;99.742;... For some reason, I can't get the contents back when I call file.read() Here's my code. filePath = "C:\\folder\\myFile.txt fileHandle = open(