随笔分类 -  Python

摘要:1、文件md5校验hashlib模块 hashlib.md5() 2、文件比对模块filecmp模块 filecmp.cmp('md5File', 'md5File_new'): ##文件一直返回True 不一致返回False 3、打开文件操作with open ..... as f: ##不用cl 阅读全文
posted @ 2017-07-03 15:20 Mr.Cui先生 阅读(600) 评论(0) 推荐(0)
摘要:1、URLError 错误产生原因: 网络无连接,即本机无法上网 连接不到特定的服务器 服务器不存在 try: except 示例: import urllib2 requset = urllib2.Request('http://www.xxxxx.com') try: urllib2.urlop 阅读全文
posted @ 2017-07-03 15:12 Mr.Cui先生 阅读(131) 评论(0) 推荐(0)