title: Identifying the type of a file without extension from binary data
body: <p>I have some files without extension. I would like associate extensions to them. For that I have written a python program to read the data in the file. My doubt is how can I identify its type without the extension without using third party tools.</p>
  
  <p>I have to identify a pdf, doc and text file only. Other type of files are not possible.</p>
  
  <p>My server is cent os</p>