how to get os.system () call to cooperate on Windows

Diez B. Roggisch deets at
Mon Oct 26 11:16:54 CET 2009

Anthra Norell wrote:

> I have a Python program that needs to copy files around. I could read
> and write which would be inefficient and would time-stamp the copy. The
> module "os" has lots of operating system functions, but none that copies
> files I could make out reading the doc twice. The function "os.system
> ('copy file_name directory_name')" turns out doesn't do anything except
> flashing a DOS command window for half a second. So my question is: How
> can one copy files on the OS level?
>    This simple question would surely have been asked many times before.
> Not to impose on anyone's patience I expect it can be answered between
> two sips of coffee.
> Thanks very much

Did you take a look at the shutil-module?


More information about the Python-list mailing list