This has probably answered somewhere at sometime but the titles I have seen don't connect so here it goes. I have seen python commands that read os.listdir(r".\bootstrapper"). What is the 'r' doing?
Cheers...
it prevents the Python interpreter from attaching any special meanings to special characters in the string (such as the backslash), and just interpret it as is (i.e., in its "raw" form). This is one way you can "escape" special characters in strings you use.
You'll often see raw strings in path specifications. Let's say the path contains a directory that starts with t, e.g., c:\tests\data.csv, so you'd not want \t to be interpreted as a tab, hence use the r modifier.
It's a raw string which removes the special nature of backslash.
re module rather than the documentation about string literals (including raw strings).It makes it a raw string. In other words, backslashes will be preserved. '\n' is interpreted as a new-line, but r'\n' is interpreted as the literal characters '\' and 'n'.
Also note that occasionally you'll see u'string' if you're using python2.x code. This implies that the string should be interpreted as a unicode string. (in python 3.x, all strings are interpreted as unicode)
u unicode indicator (python.org/dev/peps/pep-0414), making one less thing to worry about when porting 2 to 3.