File size: 904 Bytes
638456e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef79e37
 
 
 
638456e
ef79e37
638456e
ef79e37
638456e
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import gradio as gr

def greet(name):
    return f"Hello, {name}!"

# iframe code to embed Pokemon Showdown
iframe_code = """
<iframe
    src="https://play.pokemonshowdown.com/"
    width="100%"
    height="800"
    style="border: none;"
>
</iframe>
"""

def main():
    with gr.Blocks() as demo:
        gr.Markdown("# Simple Python + Pokémon Showdown Demo")

        # --- Simple Python function UI ---
        gr.Markdown("### Simple Greeting Function")
        name_input = gr.Textbox(label="Enter your name here")
        greet_button = gr.Button("Greet")
        greet_output = gr.Textbox(label="Output")

        greet_button.click(fn=greet, inputs=name_input, outputs=greet_output)
        
        # --- Embed Pokémon Showdown ---
        gr.Markdown("### Pokémon Showdown Iframe")
        gr.HTML(iframe_code)

    return demo

if __name__ == "__main__":
    demo = main()
    demo.launch()