Newbie: easiest way of renaming a file

Fredrik Lundh effbot at
Tue Mar 14 20:12:35 CET 2000

Lars Hoeyrup Jensen <robinhat at> wrote:
> 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?

    os.rename(oldname, newname)


More information about the Python-list mailing list