Sugar.mime
Jump to navigation
Jump to search
Helper Functions
Given a specific filename, how do I figure out what its mime type is?
The mime.get_from_file_name() method lets you get the mime type based on the name of a given file.
from sugar import mime ... # Get the mime type for a specific file print mime.get_from_file_name('~/file-test/sample-music.mp3')