Re: r"<path>"
- From: Carsten Haese <carsten.haese@xxxxxxxxx>
- Date: Tue, 30 Sep 2008 13:55:15 -0400
Kyle Hayes wrote:
Please describe the actual problem you're trying to solve. In what way
do slashes need to be "fixed," and why?
Well, I have decided to build a tool to help us sync files in UNC
paths. I am just building the modules and classes right now so I
haven't developed the frontend yet. I am assuming when the user
provides a path (either by typing it in, or pulling it in from a
config file), the UNC slashes are going to escape stuff in the string,
so I want to double them up.
That assumption is incorrect. While backslashes in string literals are
escape characters that must be doubled up to convey literal backslashes,
no such interpretation is made for backslashes that are read from a GUI
text box or from a file.
See for yourself:
Enter a string: blah\blah\blahsome_string = raw_input("Enter a string: ")
blah\blah\blahprint some_string
Carry on and come back when you actually have a problem ;)
--
Carsten Haese
http://informixdb.sourceforge.net
.
- References:
- r"<path>"
- From: Kyle Hayes
- Re: r"<path>"
- From: Carsten Haese
- Re: r"<path>"
- From: Kyle Hayes
- r"<path>"
- Prev by Date: Problems with encoding/decoding locales
- Next by Date: Would this be called a bug in inspect ?
- Previous by thread: Re: r"<path>"
- Next by thread: Re: r"<path>"
- Index(es):
Relevant Pages
|