title: How to know the filetype through python
body: <p>In the very beginning,I tried to do like this(hoped to get some useful information in the head):<br/></p>
  
  <pre>
  >>content=open("fileurl","rb").read()
  </pre>
  
  <p>I found that PNG (png)'s Header  is lik this: 89504E47 (I don't know wheather it's true or not)<br/>
  But when I did in this way,the result is:<br/></p>
  
  <pre>
  >>> content[:20]
  '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x01\x90'
  
  </pre>
  
  <p>the <code>\x</code>is what?<br/>
  Hope someone can help!Thanks very much!</p>