read list of dirnames and search for filenames

fscked fsckedagain at gmail.com
Tue May 1 18:47:52 EDT 2007


On May 1, 2:36 pm, Rob Wolfe <r... at smsnet.pl> wrote:
> Rob Wolfe <r... at smsnet.pl> writes:
> > fscked <fsckedag... at gmail.com> writes:
>
> >> I cannot seem to get this to work. I am hyst trying to read in a list
> >> of paths and see if the directory or any sub has a filename pattern.
> >> Here is the code:
>
> >> import os, sys
> >> from path import path
>
> >> myfile = open("boxids.txt", "r")
> >> for line in myfile.readlines():
>
> And you don't need to use ``readlines`` at all.
> This is enough:
>
>  for line in myfile:
>
> --
> HTH,
> Rob

Worked well, thanks!




More information about the Python-list mailing list