摘要: import random # 随机数模块 print(random.random()) #0-1 不包括1随机浮点数 print(random.randint(1,10)) # 1-10 包括1和10 的整数 print(random.randrange(1,10)) # 1-10包括1 不包括10的整数 print(random.sample(["a... 阅读全文
posted @ 2018-10-20 14:33 萤huo虫 阅读(159) 评论(0) 推荐(0) 编辑
摘要: import subprocess # 就用来执行系统命令 import os cmd = r'dir D:\上海python全栈4期\day23 | findstr "py"' # res = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE) # # 从管道中读取数据 管道就是 两... 阅读全文
posted @ 2018-10-20 13:45 萤huo虫 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 简介 1、一堆带有特殊意思的符号组成的式子它的作用 处理(匹配 查找 替换) 字符串 2、在爬虫中大量使用 其实有框架帮你封装了这些复杂的正则 3、在网站和手机APP注册功能中大量使用,例如判断你的邮箱地址是否正确 精准匹配: 单个字符匹配: 位置匹配: 范围匹配 判断字符是否在一个范围内: 重复匹 阅读全文
posted @ 2018-10-20 13:37 萤huo虫 阅读(333) 评论(0) 推荐(0) 编辑