Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
# A simple Python function to demonstrate code execution
|
| 4 |
def greet(name):
|
| 5 |
return f"Hello, {name}!"
|
| 6 |
|
| 7 |
# iframe code to embed Pokemon Showdown
|
| 8 |
-
# (Note: If the site blocks embedding, the iframe might not display)
|
| 9 |
iframe_code = """
|
| 10 |
<iframe
|
| 11 |
src="https://play.pokemonshowdown.com/"
|
|
@@ -21,14 +19,14 @@ def main():
|
|
| 21 |
gr.Markdown("# Simple Python + Pokémon Showdown Demo")
|
| 22 |
|
| 23 |
# --- Simple Python function UI ---
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
greet_output = gr.Textbox(label="Output")
|
| 29 |
|
| 30 |
-
|
| 31 |
|
|
|
|
| 32 |
gr.Markdown("### Pokémon Showdown Iframe")
|
| 33 |
gr.HTML(iframe_code)
|
| 34 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
| 3 |
def greet(name):
|
| 4 |
return f"Hello, {name}!"
|
| 5 |
|
| 6 |
# iframe code to embed Pokemon Showdown
|
|
|
|
| 7 |
iframe_code = """
|
| 8 |
<iframe
|
| 9 |
src="https://play.pokemonshowdown.com/"
|
|
|
|
| 19 |
gr.Markdown("# Simple Python + Pokémon Showdown Demo")
|
| 20 |
|
| 21 |
# --- Simple Python function UI ---
|
| 22 |
+
gr.Markdown("### Simple Greeting Function")
|
| 23 |
+
name_input = gr.Textbox(label="Enter your name here")
|
| 24 |
+
greet_button = gr.Button("Greet")
|
| 25 |
+
greet_output = gr.Textbox(label="Output")
|
|
|
|
| 26 |
|
| 27 |
+
greet_button.click(fn=greet, inputs=name_input, outputs=greet_output)
|
| 28 |
|
| 29 |
+
# --- Embed Pokémon Showdown ---
|
| 30 |
gr.Markdown("### Pokémon Showdown Iframe")
|
| 31 |
gr.HTML(iframe_code)
|
| 32 |
|