Looking for os.listdir() generator

Christian Heimes lists at cheimes.de
Thu Jul 23 18:08:56 EDT 2009


Nick Craig-Wood wrote:
> Christian Heimes <lists at cheimes.de> wrote:
>>  I'm looking for a generator version of os.listdir() for Python 2.5 and
>>  newer. I know somebody has worked on it because I've seen a generator
>>  version in a posting on some list or blog a while ago. I can't find it
>>  anymore. It seems my Google fu is lacking today. All I can find is a
>>  very old version of xlistdir. A Cython based solution is appreciated but
>>  please no ctypes version.
> 
> I posted exactly that yesterday I think ;-)
> 
> Note that this has a python part as well as a ctypes part because the
> version of ctypes I used doesn't support generators.  I think the
> development version does though.

Thanks Nick!

ctypes? I'm sure you wanted to say Cython :)

If you don't mind I'm going to wrap it up into a nice package and
release it on PyPI.

Christian




More information about the Python-list mailing list