摘要: import re """从开始位置开始匹配,如果开头没有则无""" re.match """搜索整个字符串""" re.search """搜索整个字符串,返回一个list""" re.findall """用来提取符合匹配规则的分组截获的字符串""" re.group(): 参考:https:/ 阅读全文
posted @ 2021-12-27 17:30 咖啡馆 阅读(32) 评论(0) 推荐(0)
摘要: import datetime import time """获取当前时间时间戳""" print(time.time()) """获取当前时间:Mon Dec 27 14:00:06 2021""" print(time.strftime("%a %b %d %H:%M:%S %Y", time. 阅读全文
posted @ 2021-12-27 14:06 咖啡馆 阅读(45) 评论(0) 推荐(0)
摘要: 说明: configparser模块是用来解析ini配置文件的解析器,可以包含一个或多个节,每个节可以有多个参数(键=值)。 创建配置文件: import configparser #配置文件 config = configparser.ConfigParser() """生成configparse 阅读全文
posted @ 2021-12-27 11:13 咖啡馆 阅读(168) 评论(0) 推荐(0)