我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用Image.VERSION。
def pillow_required(): def pil_version(version): try: return int(re.compile('[^\d]').sub('', version)) except: return 116 try: from PIL import Image, ImageDraw, ImageFont except ImportError: try: import Image import ImageDraw # NOQA import ImageFont # NOQA except ImportError: return True return pil_version(Image.VERSION) < 116
def get_lib_versions(): versions = {} #PIL try: from PIL import Image versions["PIL"] = Image.VERSION except ImportError: try: import Image versions["PIL"] = Image.VERSION except ImportError: versions["PIL"] = "Not found!" #PLY try: from ply import lex versions["PLY"] = lex.__version__ except ImportError: versions["PLY"] = "Not found!" return versions
def get_version(svn=False): "Return the version as a human-format string." return '.'.join([str(i) for i in VERSION])
def get_version(svn=False): "Returns the version as a human-format string." return '.'.join([str(i) for i in VERSION])
def versions(): import sys return ( VERSION, core.littlecms_version, sys.version.split()[0], Image.VERSION ) # --------------------------------------------------------------------