pygrep

Chris Gonnerman chris.gonnerman at newcenturycomputers.net
Wed May 2 10:49:06 EDT 2001


----- Original Message ----- 
From: "Mike Brenner" <mikeb at mitre.org>
Subject: Re: pygrep

<slash>

> The line of code:
> for filename in sys.argv[2:]:
> 
> does not accept even starred names in the current directory
> (e.g. *.txt or *.*) under windows, because it depends on the
> operating systems having already expanded the star names in
> the command line. 
> 
> This pre-expansion by the operating system is bad because
> each installation of unix comes with a limiting parameter as
> to how much can be expanded, and you always come across
> directories that have more than that many files.

Always?  I never have.
 
> Therefore, it would be nice if Python had a way of expanding
> the second argument, both the stars and question marks, and
> also the ability to iterate through all files at all levels.
> This would be WITHIN python, not depending on the operating
> system to do it.

import glob

Any other questions?  :-)






More information about the Python-list mailing list