摘要: def is_float(s): s = str(s) if s.count('.') == 1: left,right = s.split('.') #[1,1]#-s.2 if left.isdigit() and right.isdigit(): return True elif left.s 阅读全文
posted @ 2021-05-12 08:42 黑。白。 阅读(250) 评论(0) 推荐(0)
摘要: import timeFILE_NAME = 'access.log'point = 0while True: ips = {} f = open(FILE_NAME,encoding='utf-8') f.seek(point) if point == 0: #判断是否为第一次读取 f.read( 阅读全文
posted @ 2021-05-12 08:40 黑。白。 阅读(151) 评论(0) 推荐(0)
摘要: 1、解包 msg = "admin,123456" username,password = msg.split(',') 2、文件操作 r+ w+ a+ #读写 写读 追加读模式 #r相关,文件不存在都会报错,他的文件指针是在最前面的 #w相关,都会创建文件,都会清空文件内容 #a相关,如果你要读, 阅读全文
posted @ 2021-05-12 08:39 黑。白。 阅读(138) 评论(0) 推荐(0)