Thread
:
How To : Associate MPlayer, Transmission, and other apps as default handlers
View Single Post
qwerty12
2010-06-11 , 23:25
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#
227
Originally Posted by
qole
Does anyone know how to do this in Python? What library would one use?
python-gnome was already installed here, so this worked:
from gnome import gnomevfs
print "%s" % gnomevfs.get_mime_type("/home/user/MyDocs/treeview-tutorial.pdf")
Python also has a standard mimetypes module if an external dependency is not your thing.
(Sorry it's not got CODE tags around it, but my JS is disabled in Tear and the symbol input fails to come up if the clipboard is populated)
Quote & Reply
|
The Following 2 Users Say Thank You to qwerty12 For This Useful Post:
qole
,
rebhana
qwerty12
View Public Profile
Find all posts by qwerty12