[Tutor] Copy files
Alan Gauld
alan.gauld at freenet.co.uk
Tue Jan 31 18:56:38 CET 2006
> The only problem is that despite the fact that as the same user,
> I can manually change these files (so I must have the right file
> permissions ?)
Can you do it from within python at the >>> prompt
Use os.getcwd() to find out where you are
Use os.chdir() to navigate
Use os.listdir() to list the folder contents
and use shutil.copy() to copy the files.
Doing it manually from inside the >>> prompt should
show up any problems. You can even try the filecomp
call from in there too... >>> is a powerful tool.
HTH,
Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld
More information about the Tutor
mailing list