摘要: #1、写一个函数,传入一个路径和一个关键字(关键字是文件内容),找到文件内容里面有这个关键字的文件import osdef find_file(keywords,path='/Users/wym/Desktop/work/Besttest/笔记/day6'): file_list = get_all 阅读全文
posted @ 2018-12-15 20:17 mercywym123 阅读(8655) 评论(0) 推荐(0) 编辑
摘要: #2、写一个清理日志的程序,把三天前的日志删掉, # 保留今天的、昨天和前天的。 import os import time def Clear_logs(N): file_list = get_all_file() for file in file_list: if file.endswith('.log'): f = ... 阅读全文
posted @ 2018-12-15 20:16 mercywym123 阅读(908) 评论(0) 推荐(0) 编辑
摘要: #作业3、写一个注册的功能,要求数据存在数据库里面 # 1)、名字为空、已经存在都要校验 # 2)、校验通过之后,密码要存成密文的 import pymysql import hashlib def CheckUserInSql(user): conn = pymysql.connect(host='118.24.3.40',user='jxz',... 阅读全文
posted @ 2018-12-15 20:14 mercywym123 阅读(4733) 评论(0) 推荐(0) 编辑