摘要: # 1. 简单直接粗暴的方式 # f = open("stus.txt",encoding="utf-8") # content = f.read() # content = content.upper() #把字母都变成大写 # f.close() # # f = open("stus.txt", 阅读全文
posted @ 2022-03-01 23:25 青青子佩- 阅读(73) 评论(0) 推荐(0) 编辑
摘要: import random import string print(random.randint(1,100)) #产生1——100的随机整数 print(random.choice(["q",'mpp',1,100,999])) #随机选择一个,传list或字符串 print(random.sam 阅读全文
posted @ 2022-03-01 22:56 青青子佩- 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 需求分析: import time file_name = "access.log" point = 0 while True: ips = {} f = open(file_name,encoding="utf-8") f.seek(point) for line in f: if line.st 阅读全文
posted @ 2022-03-01 22:39 青青子佩- 阅读(73) 评论(0) 推荐(0) 编辑