[Pythonmac-SIG] Moving files

Just van Rossum just@letterror.com
Mon, 28 Feb 2000 17:24:37 +0100


At 3:19 PM +0100 28-02-2000, Erik van Blokland wrote:
>import os
>srcpath = 'the:old:location.txt'        # fill in your paths here!
>dstpath = 'the:new:location.txt'
>os.renames(srcpath, dstpath)

Or os.rename() (without trailing s).

os.renames() creates folders if needed and deletes folders which are left
empty, so be careful with that.

Just