I know about escaping backslashes in programming. However I'm passing in a command line argument into a Python program to parse. Whitespace is irrelevant, however via the command line, whitespace does matter. So I am trying to concatenate all argv[] arguments except the first element into a string to then parse. However a token of a single '\' is never encountered in the for loop.
The command line argument (notice whitespace around '\'):
((1 * 2) + (3 - (4 \ 5)))
Program:
import sys
string = ""
for token in sys.argv[1:len(sys.argv)]:
print(token)
if "\\" in r"%r" % token:
print("Token with \\ found")
string += token
print(string)
print("done")