摘要: 随机取一个: import random random.choice(string.digits)#从数字里随机选取一位数字: 随机取多位数: random.sample(string.digits,8) random.randint(13500000000,13999999999) random. 阅读全文
posted @ 2018-04-12 23:11 定静沉行 阅读(1273) 评论(0) 推荐(0) 编辑
摘要: 方法一:isalpha() "a".isalpha() 方法二:string.letters string.uppercase string.uppercase import string s="dasdas1212312asd" d={} for i in s: if i not in strin 阅读全文
posted @ 2018-04-12 23:06 定静沉行 阅读(7786) 评论(0) 推荐(0) 编辑
摘要: 1.把日志状态码为200得请求记录下来 记录信息(ip,访问时间,请求资源) 封装函数再次调用,健壮性try except #coding=utf-8import redef aclog(path,putpath): result="" with open(path,"r") as fp: line 阅读全文
posted @ 2018-04-12 23:00 定静沉行 阅读(218) 评论(0) 推荐(0) 编辑