954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

copy a file

I have been reading through the "python library reference" with no luck finding the module needed to copy a file. Any help would be appreciated.

shanenin
Posting Whiz in Training
217 posts since May 2005
Reputation Points: 10
Solved Threads: 17
 

the shutil module seems to be what I needed.
shutil.copy(file,destination)

shanenin
Posting Whiz in Training
217 posts since May 2005
Reputation Points: 10
Solved Threads: 17
 

For file copy shutil.copy2( sourcefile, destinationfile)
is preferred, since it retains the last access time and last modification time of the file.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

thank you for the suggestion :-)

shanenin
Posting Whiz in Training
217 posts since May 2005
Reputation Points: 10
Solved Threads: 17
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You