Omitting metacharacters in python

41 Views Asked by At

I want to assing a path to a variable a: a = "D:\misc\testsets\Real"

How can i omit the \t metacharacter without changing the folder name?

2

There are 2 best solutions below

0
ruohola On BEST ANSWER

Use raw strings:

a = r"D:\misc\testsets\Real"
0
Bibhav On

Try this:

  • r denotes raw string.
a = r"D:\misc\testsets\Real"