To get the mime type of a file in Python you can use the following snippet.
Sample Python
import mimetypes fileType,fileEncoding = mimetypes.guess_type('/path/file.exe') print fileType,fileEncoding
All the Code Snippets and Samples you need
To get the mime type of a file in Python you can use the following snippet.
import mimetypes fileType,fileEncoding = mimetypes.guess_type('/path/file.exe') print fileType,fileEncoding
You must be logged in to post a comment.
RT @CodeSnippetsNET: How to get the mime type of a file in #Python http://t.co/M8aEW9mHpV #programming #coding