How to convert a path:
t = 'c:\temp\xx'
I want to get “something like” that:
x = r't'
I usually uses
x = r’c:\temp\xx’
and receives
x = r’c:\\temp\\xx’
I don’t know how to assign the ‘r’ to another object..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t. You can apply
rstring prefix to string literals. So you need:The
r't'expression will give you a raw't'string. That’s it.If what you need is to duplicate the
\character on your destination stringx, you can use replace: