No os.copy()? Why not?

Ian Kelly ian.g.kelly at gmail.com
Mon Apr 2 16:48:38 EDT 2012


On Wed, Mar 28, 2012 at 2:12 PM, John Ladasky
<john_ladasky at sbcglobal.net> wrote:
> I'm looking for a Python (2.7) equivalent to the Unix "cp" command.
> Since the equivalents of "rm" and "mkdir" are in the os module, I
> figured I look there.  I haven't found anything in the documentation.
> I am also looking through the Python source code in os.py and its
> child, posixfile.py.
>
> Any help?  Thanks.

The os module wraps system calls, not shell commands.  You want the
shutil module, not the os module.



More information about the Python-list mailing list