Jofthomas commited on
Commit
ef79e37
·
verified ·
1 Parent(s): 638456e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
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
- with gr.Box():
25
- gr.Markdown("### Simple Greeting Function")
26
- name_input = gr.Textbox(label="Enter your name here")
27
- greet_button = gr.Button("Greet")
28
- greet_output = gr.Textbox(label="Output")
29
 
30
- greet_button.click(fn=greet, inputs=name_input, outputs=greet_output)
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