1、注册 登陆 账号
需要先建立wb文件
def login(mz,mm): f = open("wb","r",encoding="utf-8") i = 0 for line in f: li = line.strip().split("#") i = 0 if mz ==li[0] and mm == li[1]: print("登陆成功") i = 1 break else: continue if i == 0 : print("请继续输入:") main() f.close() def zhuce(): f1 = open("wb","a",encoding="utf-8") zhanghao = input("输入用户名:") mima = input("输入密码:") # "#".join(zhanghao,mima) li2 = zhanghao+"#"+mima f1.write("\n"+li2) f1.close() def main(): su = input("1登陆 2注册") if su =="1": mizi = input("账号:") mima = input("密码:") login(mizi,mima) elif su =="2": zhuce() else: print("请输入正确的选项") main() main()
2、生成验证码