renaming files

Andrew Bennetts andrew-pythonlist at puzzling.org
Mon Jan 6 23:34:50 EST 2003


On Mon, Jan 06, 2003 at 07:58:22PM -0800, Hilbert wrote:
> 
> I can't find no easy way. I don't want to use a system call to 'ls', so got
> a list
> of files with os.listdir(), but how can I get a selective list?
> I can match "test-" with string.find, but I'm really looking for test-????.*
> (csh wildcards).

Look at the glob module.

-Andrew.






More information about the Python-list mailing list