I am trying to figure out how to pass the following conditional statement to the python (-c) interpreter command command.
if sys.maxsize > 2**32:
print '64'
else:
print '32'
64
However, I constantly get syntax errors, such as:
>python -c "import sys; if sys.maxsize > 2**32: print '64' else: print '32';"
File "<string>", line 1
import sys; if sys.maxsize > 2**32: print '64' else: print '32';
^
SyntaxError: invalid syntax
It was surprisingly hard for me to find a good example of this use. I must be missing something here ...
source
share