Python: Number Conversion Chart

Ever forget how to take a hex string like "2D" and convert it into binary data? Or how to parse an ascii-binary string like "101101" into a plain integer? Me too.


This is a companion discussion topic for the original entry at http://amir.rachum.com/blog/2013/04/20/python-number-conversion-chart/

I forked this to compare it to Scala - https://gist.github.com/chris-... - but I'm not sure what "\x00\x00\x00\x2d" is supposed to be. What is this encoding (and why would you want it?)

don't think it matters for most of these

big/little endian integers. 4 bytes each.