Exemplo n.º 1
0
def register():
    if user_data['is_auth']:
        print('user is ')
        return
    while True:
        name = input('用户名').strip()
        if user.get_userinfo_interfacen(name):
            print('用户已存在')
            break
        else:
            password = input('请输入密码').strip()
            conf_password = input('请再次确认密码').strip()
            if password == conf_password:
                user.register(name, password)
                print('注册成功!!!!!')
                break
            else:
                print('两次密码不一致')
                continue
Exemplo n.º 2
0
def register():
    if user_data['is_auth']:
        print('user is login')
        return
    print('注册')
    while True:
        name = input('please input your name').strip()
        #判断用户是否存在
        if user.get_userinfo_interface(name):
            print('user is exisit')
            continue
        else:
            password = input('please input password').strip()
            conf_password = input('please config your password').strip()
            if password == conf_password:
                user.register(name, password)
                print('register success')
                break
            else:
                print('password not equles')
                continue
Exemplo n.º 3
0
def register():
    print('\033[32m注册\033[0m')
    while True:
        name = input('注册用户名 >>: ').strip()
        if name == 'q': break
        password = input('注册密码 >>: ').strip()
        password2 = input('确认注册密码 >>: ').strip()
        if password != password2:
            print('\033[31m两次输入密码不一致!\033[0m')
            continue
        flag, msg = user.register(name, password)
        if flag:
            print('\033[32m%s\033[0m' % msg)
            return
        else:
            print('\033[31m%s\033[0m' % msg)
Exemplo n.º 4
0
def register():
    print('\033[32m注册\033[0m')
    while True:
        name = input_string('用户名')
        if name == 'q': break
        password = input_string('密码')
        if password == 'q': break
        password2 = input_string('确认密码')
        if password2 == 'q': break
        if password != password2:
            print('\033[31m两次密码输入不一致!\033[0m')
            continue
        flag, msg = user.register(name, password)
        if flag:
            print('\033[32m%s\033[0m' % msg)
            return
        else:
            print('\033[31m%s\033[0m' % msg)