I'm using a modulu on a variable that has a hex numeric value, apparently I;m doing something wong:
import sys
import fileinput
if len(sys.argv) != 2:
print 'Usage: ', sys.argv[0], 'val'
sys.exit(1)
offset = sys.argv[1]
print 'offset=',offset
mod = offset%4096
if mod != 0:
print "unaligned: ",offset
since I get:
python ~dan/project/scripts/xx 0x00000001
offset= 0x00000001
Traceback (most recent call last):
File "/home/dan/project/scripts/xx", line 13, in <module>
mod = offset%4096
TypeError: not all arguments converted during string formatting
help?