Changing file names

Thomas Philips tkpmep at hotmail.com
Wed May 26 16:13:59 EDT 2004


I want to get a list of all subdirectories of a given directory, and
within each directory, change the name of each file using a
predetermined rule.

The function glob in module glob will give me a list of all the
subdirectories, and by looping over this list and repeatedly calling
glob, I can create lists of files within each directory, which are
easily edited to create lists of new filenames.

How then can I change the existing filenames to these new filenames?
What python functions should I be using, and what modules are they
contained in?

Thomas Philips



More information about the Python-list mailing list