title: python string format whats the difference between %x and %#x (hash tag hexadecimal?)
body: <p>I'm porting some python back to .NET and I can't seem to figure out the difference between the <code>%x</code> and <code>%#x</code></p>
  
  <pre><code>   print "%s: [%#x][%x] %s" % (message, self.eip, self.opcode,
                                      i.get_disasm())
  </code></pre>
  
  <p>Same with this function below seems it's just a plain <code>Hex()</code> function with 0x appended in front right why not just use <code>%x</code> instead then?</p>
  
  <pre><code>def prettify_value(value):
      if TypeOf value, (long Is int):
          value = '%#x' % value
      return value
  </code></pre>
  
  <p>Yes I can't seem to find the answer over here: <a href="https://docs.python.org/2/library/string.html" rel="nofollow">https://docs.python.org/2/library/string.html</a></p>
  
  <p>Nevermind I found it it's very fine-print</p>
  
  <p>The <code>'#'</code> option is only valid for integers, and only for binary, octal, or hexadecimal output. If present, it specifies that the output will be prefixed by '0b', '0o', or '0x', respectively.</p>