Changing file names

beliavsky@aol.com beliavsky at 127.0.0.1
Wed May 26 17:18:23 EDT 2004


tkpmep at hotmail.com (Thomas Philips) wrote:
>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

There is a "rename" function in the "os" module.



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---



More information about the Python-list mailing list