title: convert hex value to decimal value
body: <p>how to use the hex value stored in an argument to convert into decimal in python</p>
  
  <pre><code>data_size = 3#number of bytes of data to read
  offset = 0 #start offset
  
  while offset &lt;= 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
  </code></pre>
  
  <p>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.</p>
  
  <p>but the error I am getting is</p>
  
  <pre><code>i = hex (sector_header)
  TypeError: hex() argument can't be converted to hex
  </code></pre>