I'm sure that \\ is used in some way for paths in Win Python, but I have
not found anything after quite a search. I even have a six page pdf on a
file tutorial. Nothing. Two books. Nothing. When I try to open a file
along do I need, for example, Events\\record\\year\\today? Are paths
like,
* W. eWatson:
I'm sure that \\ is used in some way for paths in Win Python, but I have
not found anything after quite a search. I even have a six page pdf on a
file tutorial. Nothing. Two books. Nothing. When I try to open a file
along do I need, for example, Events\\record\\year\\today? Are
W. eWatson wrote:
I'm sure that \\ is used in some way for paths in Win Python, but I have
not found anything after quite a search. I even have a six page pdf on a
file tutorial. Nothing. Two books. Nothing. When I try to open a file
along do I need, for example, Events\\record\\year\\today?
Alf P. Steinbach wrote:
* W. eWatson:
I'm sure that \\ is used in some way for paths in Win Python, but I
have not found anything after quite a search. I even have a six page
pdf on a file tutorial. Nothing. Two books. Nothing. When I try to
open a file along do I need, for example,
Alf P. Steinbach wrote:
that you cannot write e.g. c:\windows\system32, but must
write something like c:\\windows\\system32 (try to print
that string), or, since Windows handles forward slashes as
well, you can write c:/windows/system32 :-).
Forward slashes work for some relative paths for
Steve Holden wrote:
You need to read up on string literals is all. \\ is simply the
literal representation of a string containing a single backslash. This
comes about because string literals are allowed to contain special
escape sequences which are introduced by a backslash; since this gives
W. eWatson wrote:
Steve Holden wrote:
You need to read up on string literals is all. \\ is simply the
literal representation of a string containing a single backslash. This
comes about because string literals are allowed to contain special
escape sequences which are introduced by a
W. eWatson wrote:
What am I missing here? Looks OK to me.
abc.replace(r'\',r'z')
SyntaxError: invalid syntax
A raw string can't end in a single backslash (something that
occasionally annoys me, but I've learned to deal with it).
s=r'\'
File stdin, line 1
s=r'\'
^
W. eWatson wrote:
Steve Holden wrote:
You need to read up on string literals is all. \\ is simply the
literal representation of a string containing a single backslash. This
comes about because string literals are allowed to contain special
escape sequences which are introduced by a backslash;
* Tim Chase:
Alf P. Steinbach wrote:
that you cannot write e.g. c:\windows\system32, but must
write something like c:\\windows\\system32 (try to print
that string), or, since Windows handles forward slashes as
well, you can write c:/windows/system32 :-).
Forward slashes work for some relative
On Sun, 31 Jan 2010 13:41:55 -0600, Tim Chase wrote:
The previous absolute-path fails in cmd.exe for a variety of apps because
the / is treated as a parameter/switch to the various programs.
Fortunately, the Python path-handling sub-system is smart enough to do the
right thing, even when
11 matches
Mail list logo