title: How can i get a file extension from a filetype?
body: <p>I have a list of filenames as follows</p>
  
  <pre><code>files = [
      '/dl/files/4j55eeer_wq3wxxpiqm.jpg',
      '/home/Desktop/hjsd03wnsbdr9rk3k',
      'kd0dje7cmidj0xks03nd8nd8a3',
      ...
  ]
  </code></pre>
  
  <p>The problem is most of the files do not have an extension in the filenames, what would be the best way to get file extension of these files ?</p>
  
  <p>I don't know if this is even possible because python would treat all files as <code>buffer</code> or <code>string</code> objects that do not have any <code>filetype</code> associated with them.</p>
  
  <p>can this be done at all ?</p>