Test / app.py
vanchruis's picture
Update app.py
d922166 verified
Raw History Blame Contribute Delete
547 Bytes
import os
import gradio as gr
from dotenv import load_dotenv
load_dotenv()
users=os.getenv("user")
pasword=os.getenv("pas")
def main (ussr,passw) :
if ussr == users and passw == pasword :
return "welcome"
else :
return " pasword salah"
with gr.Blocks() as demo :
with gr.Row ():
int_user=gr.Textbox(label="user")
int_pas=gr.Textbox(label="pasword",type="password")
tombol=gr.Button("login")
hasil=gr.Textbox(label="hasil")
tombol.click (
fn=main,
inputs=[int_user,int_pas],
outputs=hasil)
demo.launch()