Newbie: easiest way of renaming a file

Fredrik Lundh effbot at telia.com
Tue Mar 14 14:12:35 EST 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