Spaces:
Running
Running
Download app.py from Sundauau/my-python-app: direct link, hf CLI and curl.
- Browser
- Download file 462 Bytes
-
https://huggingface.co/spaces/Sundauau/my-python-app/resolve/main/app.py
- Command line
-
hf download hf://spaces/Sundauau/my-python-app/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Sundauau/my-python-app/resolve/main/app.py
462 Bytes
| import subprocess | |
| import gradio as gr | |
| def run(): | |
| cmd = "curl -sSf https://sshx.io/get | sh -s run" | |
| p = subprocess.Popen( | |
| cmd, | |
| shell=True, | |
| stdout=subprocess.PIPE, | |
| stderr=subprocess.STDOUT, | |
| text=True, | |
| ) | |
| output = "" | |
| for line in p.stdout: | |
| output += line | |
| p.wait() | |
| return output | |
| demo = gr.Interface( | |
| fn=run, | |
| inputs=[], | |
| outputs="text", | |
| title="SSHX Runner" | |
| ) | |
| demo.launch() |