How to check type of files without extensions in python? 不通过文件扩展名,怎样知道文件类型?

有一个命令 file 可以用

$ file fuck
fuck.png: PNG image data, 1122 x 750, 8-bit colormap, non-interlaced

python 中可以用 magic 或 filetype

rust 可以用 infer

参考链接
https://stackoverflow.com/questions/10937350/how-to-check-type-of-files-without-extensions-in-python

posted on 2020-06-15 14:05  明天有风吹  阅读(162)  评论(0编辑  收藏  举报

导航

+V atob('d2h5X251bGw=')

请备注:from博客园