May-23-2022, 04:16 PM
Hello,
I'm trying to put my Login Screen inside a Panel or Layout using Rich (Rich Link)
and I've tried following the docs but I can't seem to put a prompt text in my layout.
I want to have the User and Password Prompt inside the layout but I'm stuck on how to do that?
Does anyone know how can this be done?
Thanks in advance.
the Login Function
I'm trying to put my Login Screen inside a Panel or Layout using Rich (Rich Link)
and I've tried following the docs but I can't seem to put a prompt text in my layout.
I want to have the User and Password Prompt inside the layout but I'm stuck on how to do that?
Does anyone know how can this be done?
Thanks in advance.
the Login Function
#--------------------------------------------------------------- # Login Menu #--------------------------------------------------------------- def login(): while True: layout = Layout() layout.split_column( Layout(name="Login")) print(layout) print('\n=============================\n''\tLogin\n''=============================') user = Prompt.ask("[yellow]Enter your name (Case Sensitive) ") password = Prompt.ask("[yellow]Enter your password ") #If the credentials are validated -> Run validate function -> Go to according menu #Else -> Print error message and show login screen again if validate(user, password): break else: invalidCredentials = Text('\nYou are not registered to use this program') invalidCredentials.stylize("bold red") print(invalidCredentials) #---------------------------------------------------------------