file open/read/name etc, not working

globalrev skanemupp at yahoo.se
Thu May 15 12:53:29 EDT 2008


On 15 Maj, 18:33, "Andreas Tawn" <andreas.t... at ubisoft.com> wrote:
> >import os
>
> >print os.path.exists('C:/Python25/myPrograms/netflix/test.txt')
> >d=open('C:/Python25/myPrograms/netflix/flim.txt', 'r')
> >d.readline()
>
> >returns true in the shell but prints no text even though the document
> >contains text.
>
> >d.name returns nothing, d.name() raises an error.
> >--
> >http://mail.python.org/mailman/listinfo/python-list
>
> Try...
>
> import os
>
> print os.path.exists('C:/Python25/myPrograms/netflix/test.txt')
> d=open('C:/Python25/myPrograms/netflix/flim.txt', 'r')
> for line in d:
>         print line
>
> And I'm guessing that's a typo in flim.txt?
>
> Cheers,
>
> Drea

nah no typos i figured this out



More information about the Python-list mailing list