摘要: 模块 -logging 一:在控制台显示:默认 import logging logging.debug("debug") logging.info("debug") logging.warning("warning") logging.error("error") logging.critical 阅读全文
posted @ 2017-10-26 22:40 两只老虎111 阅读(191) 评论(0) 推荐(0)
摘要: 模块 HASH 一 MD5 import hashlib h = hashlib.md5() # In [237]: h # Out[237]: """ 'block_size', 'copy', 'digest', 'digest_size', 'hexdigest', 'name', 'update'] """ h.update("晚饭想吃肉".encode()) pri... 阅读全文
posted @ 2017-10-26 17:53 两只老虎111 阅读(250) 评论(0) 推荐(0)
摘要: 模块 –SYS os模块是跟操作系统的交互 sys是跟python解释器的交互 sys.argv命令行参数List,第一个元素是程序本身路径 返回一个列表In [218]: sys.argv Out[218]: ['C:\\Python35-32\\Scripts\\ipython']sys.exit(n)exit(...) exit([status])In [220]: sys.exi... 阅读全文
posted @ 2017-10-26 17:23 两只老虎111 阅读(297) 评论(0) 推荐(0)
摘要: 模块—Os模块: os.getcwd()获取当前工作目录,即当前python脚本工作的目录路径In [25]: os.getcwd() Out[25]: 'C:\\Users\\***'os.chdir(path)改变当前的工作目录In [43]: os.getcwd() Out[43]: 'd:\\' In [45]: os.chdir("c:/") In [46]: os.getcwd() O... 阅读全文
posted @ 2017-10-26 16:56 两只老虎111 阅读(332) 评论(0) 推荐(0)