
1.import osimport os.path as pathfile_pathD:\\vscode python\\code\\作业\\network4.pyfile_path_floderD:\\vscode python\\code\\作业\\network4.pydef traverse(path1):for entry in os.listdir(path1):file_pathpath.join(path1,entry)if path.isfile(file_path):print(f文件,{file_path})elif path.isdir(file_path):traverse(full_path)traverse(file_path_floder2.import hashlibdef entryption(str1):slat$$$reshashlib.md5(str1.encode(utf-8))res.update(slat.encode(utf-8))return res.hexdigest()username_mysqlentryption(张三)passworld__mysqlentryption(123456)usernameinput(用户名)passworldinput(密码)def login(username,passworld):return True if entryption(username)username_mysql and entryption(passworld)passworld__mysql else Falseprint(登陆成功if login(username,passworld) else登陆失败)