-1

i'm new to python, i wrote script that query from db, and getting path looking like this:

...\\dev$\\AUTOMATION\\Logs\14-01-16_15-50-57_143

when i print the result i see that:

the \14 
change to hexa-  x0c

i want to access this link, in order to do so i need to add \ so the link will look like this:

...\\dev$\\AUTOMATION\\Logs\\14-01-16_15-50-57_143

I tried to os.path.dirname re.find split and didnt get what i needed. please i tried so many suggestions i saw in xda and non helped me.

Thanks,


Thanks for the response. I know the escape , like: r'MyString', or \ when there is \ The problem is that i get the path from DB and in the DB the path i receive is like this .. \AUTOMATION\Logs\15-01-16_15-50-57_143

and python load it immediately to x0c

I hope the problem sounds more clear..

Thnaks

elixenide
  • 44,308
  • 16
  • 74
  • 100
Reguy
  • 1
  • Possible duplicate of [What exactly do "u" and "r" string flags do in Python, and what are raw string literals?](http://stackoverflow.com/questions/2081640/what-exactly-do-u-and-r-string-flags-do-in-python-and-what-are-raw-string-l) – Łukasz Rogalski Feb 02 '16 at 14:35

1 Answers1

0

When you print a string, you need to escape the backslashes with another backslash. \14 is getting read as a hex value, but \\14 will be printed correctly.

pattivacek
  • 5,617
  • 5
  • 48
  • 62