how to use the hex value stored in an argument to convert into decimal in python
data_size = 3#number of bytes of data to read
offset = 0 #start offset
while offset <= 784128:
for i in range (0,784128):
Target_file.seek(offset)
s = Target_file.read(data_size)
i = hex (s)
str(i)
output.write(str(i))
offset = offset + 3
The above is the program I tried to input hex value into an argument called 's' and tried to convert the value into decimal value and write it into a file.
but the error I am getting is
i = hex (sector_header)
TypeError: hex() argument can't be converted to hex