zl程序教程

您现在的位置是:首页 >  后端

当前栏目

python模块之imghdr(识别不同格式的图片文件)

Python文件识别模块 图片 格式 不同
2023-09-11 14:17:15 时间
# -*- coding: utf-8 -*-
#python 27
#xiaodeng
#python模块之imghdr(识别不同格式的图片文件)



import imghdr
'''>>> help(imghdr)
Help on module imghdr:
FUNCTIONS
    what(file, h=None)

DATA
    __all__ = ['what']
'''
#imghdr 模块可识别不同格式的图片文件.
url=r'9.gif'
print imghdr.what(url)