Copying files in Python

Ben Finney bignose-hates-spam at
Thu Jul 3 06:57:04 CEST 2003

On Thu, 03 Jul 2003 03:26:33 GMT, Russell Lear wrote:
> A simple question from a python beginner: How do I do 'cp -p source
> destination' where source could be a list of files and destination
> could be a file or directory (I could break the operation up if it
> must be file to file)?  Perserving file creation time is important.
> Platform independence also nice.

The 'shutil' module is your friend:


 \         "Truth would quickly cease to become stranger than fiction, |
  `\                  once we got as used to it."  -- Henry L. Mencken |
_o__)                                                                  | 9CFE12B0 791A4267 887F520C B7AC2E51 BD41714B

More information about the Python-list mailing list