[Tutor] Move all files to top-level directory

Dotan Cohen dotancohen at gmail.com
Tue Apr 13 09:14:46 CEST 2010


> from the docs:
> os.rename(src, dst)¶Rename the file or directory src to dst. If dst is a
> directory, OSError will be raised.

I did read that, thank you. That is why I asked how to override, as I
understood that Python was functioning exactly as intended.


> It seems what you wan to
> do is os.rename(toMove, currentDir+f)
>

Well, actually, that would be currentDir+"/"+f but you are correct! I
was thinking too much in terms of the unix mv command, which adds that
automatically. Thank you!


-- 
Dotan Cohen

http://bido.com
http://what-is-what.com


More information about the Tutor mailing list