Mime function in Python

Mark Berry pengo243 at hotmail.com
Wed Oct 3 08:02:49 EDT 2001


Anyone know of an easy way to determine the mime type of a file?

For example...  (my dream method)

type = dream.get_mime('/tmp/myfile.jpg')
print type
['image/jpeg']



basically something to that effect..  Is there anything in the core
libs that would do something like that or am I going to have to hack
something out?  

Cheers

.mark




More information about the Python-list mailing list