Copying files in Python

Ben Finney bignose-hates-spam at and-zip-does-too.com.au
Thu Jul 3 00:57:04 EDT 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:

    <http://www.python.org/doc/current/lib/module-shutil.html>

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




More information about the Python-list mailing list