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

# -*- 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)

 

posted @ 2015-11-21 16:12  Xiao|Deng  阅读(898)  评论(0编辑  收藏  举报