[Tutor] lst file
remco at gerlich.nl
Thu Jan 24 11:54:04 CET 2008
Many things could be wrong; perhaps with reading the file, or the lines, or
with printing them... Debugging usually consists of what the problem is
exactly, where it occurs.
First thing I'd look at is seeing whether the lines do get read. I would
change "print line" into "print len(line)" and see if the lines are empty,
or filled with unprintable things.
Also, what sort of file is it?
On Jan 24, 2008 11:42 AM, SwartMumba snake <swartmumba at yahoo.com> wrote:
> I am trying to read from a specific .lst file. When I read from it, it
> just prints out blank lines and I am sure that this file contains content.
> This is what I am using to read from the file:
> f = open("C:\\Users\\UserName\\Directory\\words.lst")
> for line in f:
> print line
> Do you guys know what is wrong?
> Thanks in advance.
> Never miss a thing. Make Yahoo your homepage.<http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor