def regist():
f = open(r"G:\课件\day09 初始函数\code\day009 初始函数\account", mode="r", encoding="utf-8") # 注意mode="r"还是"r+",容易错!!!!!!!
while 1:
username = input("请输入用户名:")
password = input("请输入密码:")
for line in f:
if username == line.strip().split(":")[0]:
print("用户已经注册")
break
else:
print("恭喜,注册成功")
f.write("\n" + username + ":" + password)
f.flush()
f.close()
return regist() # -->没写这个,上面所有的白写!!!!!!!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)