little help

Psybar Phreak psybar_phreak at yahoo.com
Sun May 11 00:23:03 EDT 2003


sorry - add this

filesInDir = os.listdir(dirpath)
filesInDir.sort()

its supposed to go through all the files in the directory and get the first
2 lines out of the first file, print them, go to the next file, get the
first 2 lines, print them, etc.

im not getting a compile error - it just aint printing anything to screen!

WEIRD!

"Psybar Phreak" <psybar_phreak at yahoo.com> wrote in message
news:3ebdcfc9$0$16259$afc38c87 at news.optusnet.com.au...
> would anyone know why this isn't working?
>
> for diaryname in filesInDir:
>  InFile = open(diaryname, 'r')
>  lines = InFile.readlines()
>  InFile.close()
>
>  diaryTitle = lines[0].strip()
>  diaryDesc = lines[1].strip()
>
>
> thanks!
>
>






More information about the Python-list mailing list