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

Anthra Norell anthra.norell at bluewin.ch
Mon Oct 26 16:34:57 EDT 2009


Diez B. Roggisch wrote:
> 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?
>
> Diez
>   
No, I didn't. There's a number of modules I know by name only and 
shutils was one of them. A quick peek confirmed that it is exactly what 
I am looking for. Thank you very much for the advice.

Frederic




More information about the Python-list mailing list