# -*- encoding: utf-8 -*-
"""
@File : test.py
@Modify Time @Version @Description
------------ -------- -----------
2021/8/24 2:11 下午 1.0 None
"""
# import lib
import os
import time
def first():
print("-" * 42)
print("-" * 42)
print("欢迎来到大学生(中学生)学习与知识管理管理")
print("-" * 42)
print("-" * 42)
print(" 是否登录您的账号? ")
print("-" * 42)
print(" 1.是 2.否 3.注册账号 ")
print("-" * 42)
select = input("")
if int(select) == 1:
go()
elif int(select) == 2:
quit()
elif int(select) == 3:
register()
name_list = []
user = ""
def go():
go1 = open(r"/Users/lingoace/re.txt", "r+")
username = input("请输入您的用户名:")
print("----------------------")
password = input("请输入您的密码:")
user = username + " " + password
save_name_list = go1.read()
go1.close()
if user in save_name_list:
interface()
else:
print("用户不存在或密码错误")
first()
def register():
re1 = open(r"/Users/lingoace/re.txt", "a+")
username = input("请输入您要注册的用户名:")
print("----------------------")
password = input("请输入要注册您的密码:")
print("----------------------")
repeatpassword = input("再次确定你的密码:")
print("----------------------")
if password == repeatpassword:
print("注册成功")
user = " " + username + " " + password
name_list.append(user)
re1.write(user)
re1.close()
first()
else:
print("两次密码不一致,请重新输入")
register()
def quit():
print("成功退出管理系统")
def content_management():
print("成功进入内容管理区")
def analysis():
print("成功进入分析区")
def information_viewing():
print("成功进入信息查看区")
def interface():
print("------------------------------------------")
print(" 登录成功,请选择你要进入的区块 ")
print("------------------------------------------")
print(" 1.内容管理区 ")
print(" 2.分析区 ")
print(" 3.信息查看区 ")
select = input("")
if int(select) == 1:
content_management()
elif int(select) == 2:
analysis()
elif int(select) == 3:
information_viewing()
if __name__ == '__main__':
file = open(r"/Users/lingoace/knowledgeSystem.txt", "a+")
scale = 5
print("------正在进入------")
for i in range(scale + 1):
a = '*'
b = '.'
c = (i / scale) * 100
print("{:^3.0f}%[{}->{}]".format(c, a, b))
time.sleep(0.1)
first()