Link to home
Start Free TrialLog in
Avatar of templeavenue
templeavenue

asked on

File Copying..

I am pretty new to Python. Can someone tell me/good tutorial how to make file copies in Python..
Avatar of zenpro
zenpro

Hi templeavenue,

you can use the following:

import shutil
shutil.copy2(source, destination)


shutil.copy will perform the copy using the current date and time, while copy2 will copy over also the date and time of the original file's last modification. You can read more about Shutil here: http://docs.python.org/lib/module-shutil.html

Avatar of templeavenue

ASKER

sorry... actually..what I wanted to do is read a drive (hard dirve, cd) without knowing the name/structures of the file/folders(if possible)... sorry for confusion... can i still use those functions??

Thanks,
Kelvin
ASKER CERTIFIED SOLUTION
Avatar of pepr
pepr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial