'''头发掉了不少'''import os'''用户注册'''def register():
username= input("请输入注册用户名:")
password= input("请输入注册密码:")
with open('user.txt', encoding='utf-8', mode='r+') asf1:for i inf1:
hard= i.split(' ')if username == hard[0]:
print('用户已存在')break
else:
f1.write(username+ ' ' + password + '\n')
print('{}用户注册成功'.format(username))'''用户登录'''def login():
count= 1
while count <= 3:
username= input('请输入用户名:')
password= input('请输入密码:')
with open('user.txt', encoding='utf-8') asf:for i inf:
new_line= i.strip().split(' ')if username == new_line[0] and password ==