I\'m trying to find a way to print a string in raw form from a variable. For instance, if I add an environment variable to Windows for a path, which might look like \'
\'
In general, to make a raw string out of a string variable, I use this:
string = "C:\\Windows\Users\alexb" raw_string = r"{}".format(string)
output:
'C:\\\\Windows\\Users\\alexb'