title: pythonic way to hex dump files
body: <p>my question is simple:</p>
  
  <p>Is there any way to code in a pythonic way that bash command?</p>
  
  <pre><code>hexdump -e '2/1 "%02x"' file.dat
  </code></pre>
  
  <p>Obviously, without using os, popen, or any shortcut ;)</p>
  
  <p>EDIT: although I've not explicitly specified, it would be great if the code was functional in Python3.x</p>
  
  <p>Thanks!</p>