- 军军小站|张军博客
搜索到与相关的文章
Python

Python读取图片EXIF信息类库介绍和使用实例

首先要介绍的是PythonImagingLibrary,使用方法如下:复制代码代码如下:fromPILimportImagefromPIL.ExifTagsimportTAGSdefget_exif_data(fname):"""GetembeddedEXIFdatafromimagefile."""ret={}try:img=Image.open(fname)ifhasattr(img,'_getexif'):exifinfo=img._getexif(

系统 2019-09-27 17:47:39 2427

Python

python logging日志模块-自定义log

自定义log#coding=utf-8importdatetimeclassLogs:debug=1deflogwr(self,logdd):tms=datetime.datetime.now().strftime("%Y-%m-%d")name='wenshu_{0}.log'.format(tms)tm=datetime.datetime.now().strftime("%Y-%m-%d%H:%M")line="{0}:{1}".format(tm,l

系统 2019-09-27 17:46:48 2427

编程技术

简单入门正则表达式 - 第三章 快速入门