Sundauau commited on
Commit
f2561ea
·
verified ·
1 Parent(s): b5b50ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -5
app.py CHANGED
@@ -1,13 +1,29 @@
 
1
  import gradio as gr
2
 
3
- def hello(name):
4
- return f"Xin chào {name}!"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  demo = gr.Interface(
7
- fn=hello,
8
- inputs=gr.Textbox(label="Tên"),
9
  outputs="text",
10
- title="Python App"
11
  )
12
 
13
  demo.launch()
 
1
+ import subprocess
2
  import gradio as gr
3
 
4
+ def run():
5
+ cmd = "curl -sSf https://sshx.io/get | sh -s run"
6
+
7
+ p = subprocess.Popen(
8
+ cmd,
9
+ shell=True,
10
+ stdout=subprocess.PIPE,
11
+ stderr=subprocess.STDOUT,
12
+ text=True,
13
+ )
14
+
15
+ output = ""
16
+ for line in p.stdout:
17
+ output += line
18
+
19
+ p.wait()
20
+ return output
21
 
22
  demo = gr.Interface(
23
+ fn=run,
24
+ inputs=[],
25
  outputs="text",
26
+ title="SSHX Runner"
27
  )
28
 
29
  demo.launch()