added login screen to frontend ui

This commit is contained in:
Crimson Hawk 2024-06-18 09:23:39 +08:00
parent e232f4ab32
commit 87674f2835
Signed by: CrimsonHawk
GPG key ID: 0804DD39BB9BF5AC

View file

@ -4,11 +4,16 @@ import base64
import hashlib import hashlib
import string import string
import time import time
#from libexam.py import * import keyboard
import os
from libexam.py import *
def __init__(): def clearConsole():
print("test") command = 'clear'
if os.name in ('nt', 'dos'): # If computer is running windows use cls
command = 'cls'
os.system(command)
print(""" print("""
@ -21,3 +26,35 @@ print("""
""") """)
print(f"libexam frontend UI initiated") print(f"libexam frontend UI initiated")
sleep(1)
print("\r")
libexam.setmode(1) #setmode as client
username = ""
print(f"""
______________________________
| |
| libexam demo frontend ui |
| |
| Username:{username}
| |
| (L)ogin |
|______________________________|""")
while (True):
key = keyboard.wait()
#print(f"{key} pressed")
username = username + key
clearConsole()
print(f"""
______________________________
| |
| libexam demo frontend ui |
| |
| Username:{username}
| |
| (L)ogin |
|______________________________|""")