Newbie: easiest way of renaming a file

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


Lars Hoeyrup Jensen <robinhat at rhk.dk> 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)

</F>





More information about the Python-list mailing list