Newbie: easiest way of renaming a file

Patrick Phalen python-list at teleo.net
Tue Mar 14 20:14:57 CET 2000


[Lars Hoeyrup Jensen, on Tue, 14 Mar 2000]
:: I want to rename a lot of files with a Python-program. Is it necessary
:: to read the whole file, write it to a new file and then delete the
:: original file?
:: 
:: I have tried to search the newsgroup archives but couldn't find
:: anything.

Searching the newsgroup archive would not be the recommended first
step for a basic question like this, since most people on this newsgroup
would have already read the Python Tutorial and the Python Language
Reference, and so would already know the answer <wink>.

Take a look at the Python Library Reference. You'll find it at
http://www.python.org/doc/current/. You'll note that it carries a
recommendation to "keep this under your pillow." If you're serious
about learning Python, this is Good Advice.

Take a look at Section 6 for Operating System Services.




More information about the Python-list mailing list