[Tutor] if file == exists, then dont copy it
Kirby Urner
urnerk@qwest.net
Sat, 24 Nov 2001 14:06:03 -0800
>
>
>The program seem to skip everything after force=0 and
>then exit.
Seems like the exists() thing is always returning
false.
You should say what platform and give an example of a
file parameter you're passing that you know exists.
If you're in Windows and using a backslash, you need
to escape it with another backslash, or use r for
'raw'. E.g.
>>> exists(r"c:\My Documents\fft.pdf") # OK
1
>>> exists("c:\\My Documents\\fft.pdf") # OK
1
>>> exists("c:\My Documents\fft.pdf") # oops
0
This could be the kind of problem you're having. If
it's UNIX, yet other issues might be to blame.
Kirby