guessing mime type without extension?

Michael Ströder michael at
Tue Jul 10 22:19:28 CEST 2001

Michael wrote:
> Is there a way to guess a files mime type by content rather than extension
> similar to the way the Unix 'file' command works?

Take a look at the modules sndhdr and imghdr for images and
sounds. Don't know about others.

Ciao, Michael.

More information about the Python-list mailing list