hi I get user argv from command line as follows: '0x000aff00'
and I want python to treat it as hex directly...
str = sys.argv[1]
how is it possible? thanks!
hi I get user argv from command line as follows: '0x000aff00'
and I want python to treat it as hex directly...
str = sys.argv[1]
how is it possible? thanks!
try:
i = int(sys.argv[1], 16)
except Exception,e:
print e
else:
# carry on