title: Easier / better way to convert hexadecimal string to list of numbers in Python?
body: <p>My goal is to  get a 64 characters long hex number from a user (which represent a serial number) and convert to c_type 32bytes number.
  Serial Number is defined like this:</p>
  
  <pre><code>_sn =  c_ubyte * 32
  </code></pre>
  
  <p>I accept SN string from user into args.sn variable. Here's how I managed to solve it. I'm sure there is an easier and more elegant way, would appreciate your help.</p>
  
  <pre><code>SN_List= []
  for i in range(0,len(args.sn),2):
      myByte = args.sn[i: i+2]
      num = int("0x" + myByte,16)
      SN_List.append(num)
  
  if(len(SN_List) != 32):
      print("S/N is not valid, it should be 64 hex characters long")
      return 1
  _sn = (c_ubyte * 32)(*SN_List)
  </code></pre>