No os.copy()? Why not?

Ian Kelly ian.g.kelly at gmail.com
Tue Apr 3 12:29:24 EDT 2012


On Tue, Apr 3, 2012 at 12:24 AM, Thomas Rachel
<nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915 at spamschutz.glglgl.de>
wrote:
> Am 02.04.2012 23:11 schrieb HoneyMonster:
>
>
>> One way:
>> import os
>>
>> os.system ("cp src sink")
>
>
> Yes. The worst way you could imagine.
>
> Why not the much much better
>
> from subprocess
> subprocess.call(['cp', 'src', 'sink'])


In any case, either of these approaches will only work in UNIX,
whereas shutil is cross-platform.



More information about the Python-list mailing list