#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "cc"
# Date: 2018/9/18
username = input('请输入你要注册的用户名:')
password = input('请输入你要注册的密码:')
with open('list_of_information',mode='w',encoding='utf-8') as obj :
obj.write('{}\n{}'.format(username,password))
print('congratulations! register success!')
lis = []
i = 0
while i < 3:
usn = input('请输入用户名:')
pwd = input('请输入密码:')
with open('list_of_information',mode='r+',encoding='utf-8') as f1:
for line in f1:
lis.append(line)
if usn == lis[0].strip() and pwd == lis[1].strip():
print('登入成功')
break
else:print('账号密码错误')
i += 1