faqts : Computers : Programming : Languages : Python : Modules : os

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

171 of 195 people (88%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

How can I rename a file using Python?
How do I move a file from one directory to another in Python?

Feb 29th, 2000 20:44
Nathan Wallace, John Lehmann


Try using the os module:

    os.rename(old, new)