title: How to convert to floating point (from HEX String)?
body: <p>I just learned python for couple of weeks and I have no idea on the data type converting. So, I have a very big data contains something like this, which I imported from SQL.</p>
  
  <pre><code>i='0x9406920691068F068D068A0688068506820680067E067D067D067D067B067906760674066E066A066806650665066506650669066F067D069206AD06CD06EE060F072.........' 
  </code></pre>
  
  <p>I imported the SQl data to python using this code (which I acquired from previous questions) </p>
  
  <pre><code>import pyodbc
  from struct import pack, unpack
  
  conn_str = (
            r'Driver={ODBC Driver 11 for SQL Server};'
            r'Server=Laptop;'
            r'Database=Access;'
            r'Trusted_Connection=yes;'
            r'CHARSET=UTF8;'
          )
  
  cnxn = pyodbc.connect(conn_str)
  cnxn.add_output_converter(pyodbc.SQL_VARBINARY, hexToString) #to copy the varbinary
  cursor = cnxn.cursor()
  
  def convert_hex_to_int(n:int, interval:int):
      splitted = [hex(n)[2:][i:i+interval] for i in range(0, len(hex(n)[2:]), interval)]
      return [int(hex(unpack('&lt;H', pack('&gt;H', int(i, 10)))[0]), 10) for i in splitted]
  
  cursor.execute(query)
      row = cursor.fetchone()
  </code></pre>
  
  <p>Based on that, if I type <code>print(row)</code>, it generates result </p>
  
  <pre><code>'0x9406920691068F068D068A0688068506820680067E067D067D067D067B06790676....'
  </code></pre>
  
  <p>when I type <code>print(type(row))</code> the data type is <code>&lt;class 'pyodbc.Row'&gt;</code></p>
  
  <p>when I use the function <code>print(convert_hex_to_int(row, 4))</code> to get the results by taking 4 bytes at the time and fllip it, it generates error: </p>
  
  <blockquote>
    <p>TypeError: 'pyodbc.Row' object cannot be interpreted as an integer</p>
  </blockquote>
  
  <p>The plan is to get <code>'0x94069206..'</code> to be <code>0694 0692</code> and convert it to int/floating point to be <code>1684 1682</code> and so on. </p>