Copying Files

Fredrik Lundh fredrik at
Sat Jun 7 05:19:36 CEST 2003

Stan Cook wrote:

> Can someone give me a clue on using the copyfile function?  I've tried
> implementing it in this fashion without success.
> copyfile(d:\work\temp.dbf, d:\w)

you have to put strings in quotes, and you also have to be
extra careful if the strings contain backslashes:

try this:

    copyfile("d:/work/temp.dbf", "d:/w")

or this:

    copyfile(r"d:\work\temp.dbf", r"d:\w")

a couple of minutes spent on reading the Python tutorial might
be a good investment.  see e.g.

or read one or more of the documents listed here:


More information about the Python-list mailing list