title: How to print hex number in little endian, padded zeroes, and no '0x' in python?
body: <p>I want to write a loop that will print 1 through 50000  in 4B hex number format. However, I need the hex numbers to be in little endian format, display all zeroes up to 4B, and show no '0x' at the beginning.</p>
  
  <p>Example:</p>
  
  <p>The number 50,000 is 0xc350 in hex.</p>
  
  <p>I want to print: 50C30000</p>
  
  <p>This is what I have so far, I just don't know how to add the zeroes to get it to be 4B format:</p>
  
  <pre><code>import struct
  print hex( struct.unpack( '&lt;H', struct.pack('&gt;H', 50000) ) [0] ) [2:].upper()
  #Output is 50C3
  </code></pre>
  
  <p>~Thanks</p>