Mark Bystry wrote:
> Well, immediately I am having problems. Be patient with me.
We will be, you're doing great so far :-)
>
> This what I have...
>
> copy_file.py
> ############################################
>
> import os
> import shutil as sh
>
> sh.copy('C:\testing_it.txt', 'D:\')
Backslash is an escape character in Python string constants. \t actually
inserts a tab character in the string.
You have several choices:
'C:/testing_it.txt' - forward slashes work fine too
'C:\\testing_it.txt' - double the \ to make it a literal.
r'C:\testing_it.txt' - 'r' prefix makes it a 'raw' string, backslashes
are (mostly) treated as literals rather than escapes.
Kent
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor