2020年9月13日

python-zipfile模块

摘要: 1.文件的压缩,把html文件,压缩成zip包 2.文件解压,把zip文件解压 阅读全文

posted @ 2020-09-13 22:41 抓虫者 阅读(173) 评论(0) 推荐(0) 编辑

python-shutil模块

摘要: import shutil# 删除指定文件夹shutil.rmtree(r'D:\uiauto\yy\20200913report') 阅读全文

posted @ 2020-09-13 22:33 抓虫者 阅读(76) 评论(0) 推荐(0) 编辑

python-sys模块

摘要: 1. sys.exit(arg) arg参数可选,默认为0。 ①给出退出状态的整数:0被视为“成功终止”,任何非零值被shell等视为“异常终止” 2. exit() 最终“仅”引发异常,因此只有在主线程调用时才会退出进程,并且不会截获异常,直接退出程序执行。 阅读全文

posted @ 2020-09-13 22:23 抓虫者 阅读(56) 评论(0) 推荐(0) 编辑

python-os模块

摘要: import os# 当前py文件路径branch_path = os.path.dirname(os.path.abspath(__file__))print(branch_path) # D:\uiauto\yynow = 20200913reportfile = os.path.join(br 阅读全文

posted @ 2020-09-13 22:15 抓虫者 阅读(254) 评论(0) 推荐(0) 编辑

python-threading.Thread(多线程)

摘要: import timedef func(name,n): print(f'{name} start') time.sleep(n) print(f'{name} end')t1 =Thread(target=func,args=('线程1',1))t2 =Thread(target=func,arg 阅读全文

posted @ 2020-09-13 22:00 抓虫者 阅读(313) 评论(0) 推荐(0) 编辑

python-string

摘要: 阅读全文

posted @ 2020-09-13 21:45 抓虫者 阅读(44) 评论(0) 推荐(0) 编辑

python-re模块 .,[],\d,\w,\s,\S,\D,\W的用法及重复匹配

摘要: re模块 . 匹配任意1个字符(除了\n)[ ] 匹配[ ]中列举的字符\d 匹配数字,即0-9\D 匹配非数字,即不是数字\s 匹配空白,即 空格,tab键\S 匹配非空白\w 匹配非特殊字符,即a-z、A-Z、0-9、_、汉字\W 匹配特殊字符,即非字母、非数字、非汉字、非_ 重复匹配: . ? 阅读全文

posted @ 2020-09-13 21:08 抓虫者 阅读(3628) 评论(0) 推荐(2) 编辑

python-re模块(compile,findall:查找结果是列表,sub:替换所有符合条件的元素,serach:查找结果是一个元素 #字符串以空格为分割元素)

摘要: # ①:单独使用findall import re v3 = re.findall(r"html$", "https://docs.python.org/3/whatsnew/3.6.html")v2 = re.findall(r"^http", "https://docs.python.org/3 阅读全文

posted @ 2020-09-13 21:05 抓虫者 阅读(709) 评论(0) 推荐(0) 编辑

2020年9月12日

python-类继承之后,对象的逻辑交互

摘要: 阅读全文

posted @ 2020-09-12 22:24 抓虫者 阅读(95) 评论(0) 推荐(0) 编辑

python模块,类,继承浅谈

摘要: ①:直接导入整个模块 ②:导入一个类,不需要加模块名,直接调用类,但是只能调用导入的类 ③:导入多个类,不需要加模块名,直接调用导入的多个类 ④:导入所有类,不需要加模块名,直接调用所有类 ⑤:导入模块,类的继承 ⑥:导入模块的单个类及继承 阅读全文

posted @ 2020-09-12 21:50 抓虫者 阅读(308) 评论(0) 推荐(0) 编辑

导航