摘要: 发起http请求 获取返回值 返回值是字符串 第三方模块安装 pip install requests 返回值格式 xml html jaon json 功能 loads 字符串》》》列表 字典 字符串里面必须是“”,因为其他的编程语言字符串都是“” dups 列表》》》字符串 xml 添加子节点 阅读全文
posted @ 2017-11-20 22:24 口水哥 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 简单检查qq在线 xml 之 tag attrilb text运用 阅读全文
posted @ 2017-11-19 09:12 口水哥 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 字符: . 匹配除换行符外所有的字符 \w 匹配字母或 数字或 下划线或汉子 大写的相反 \d 匹配数字 大写的相反 \s 匹配空格 大写的相反 ^ 匹配字符串的开头 $ 匹配字符串的末尾 次数: * 0-多次 + 1到多次 ? 0或1次 {n} 重复n此 {n,} 重复n到更多次 {n-p} 重复 阅读全文
posted @ 2017-11-17 21:46 口水哥 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 利用递归获取斐波那契数列 阅读全文
posted @ 2017-11-13 10:32 口水哥 阅读(1812) 评论(0) 推荐(0) 编辑
摘要: li = [21,3,4,58,6] for n in range(1,len(li)): # print(n) # print(li) for s in range(len(li)-n): # print(s) if li[s] > li[s+1]: ret = li[s] li[s] = li[s... 阅读全文
posted @ 2017-11-09 23:13 口水哥 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 先创建文件ha.log 阅读全文
posted @ 2017-11-09 20:51 口水哥 阅读(154) 评论(0) 推荐(0) 编辑
摘要: import random temp = '' for i in range(4): red1 = random.randrange(0,4) if red1 == 1 or red1 == 3: temp += str(red1) else: red = random.randrange(65,91) c = chr(re... 阅读全文
posted @ 2017-11-08 16:44 口水哥 阅读(174) 评论(0) 推荐(0) 编辑
摘要: def f1(p): li = [] for i in range(len(p)): if i % 2 == 1: li.append(p[i]) return li ret = f1([1,2,3,4,5]) print(ret) 阅读全文
posted @ 2017-11-08 12:38 口水哥 阅读(1044) 评论(0) 推荐(0) 编辑
摘要: def f1(*p): for i in p: # print(i) l = len(i) if l > 2: return(i[:2]) else: return (i) ret = f1([11,22,33]) print(ret) 阅读全文
posted @ 2017-11-08 10:50 口水哥 阅读(2251) 评论(1) 推荐(0) 编辑
摘要: def f1(p): # print(p) digit_num = 0 #数字 alpah_num = 0 #字母 space_num = 0 #空格 qita_num = 0 #其他 for i in p: if i.isdigit(): digit_num +=1 elif i.isalph... 阅读全文
posted @ 2017-11-08 10:18 口水哥 阅读(1812) 评论(1) 推荐(0) 编辑