首页 > python 怎样获取某个文件的 MIME type?
文件的扩展名被改了,无法判断该文件是什么文件,想通过获取 mime-type 进行检测,那么问题来了。如何检测?
import mimetypes print mimetypes.guess_type(filename)[0]