Download app.py from MegaTronX/Subsystem_OS_Command_Access: direct link, hf CLI and curl.
- Browser
- Download file 591 Bytes
-
https://huggingface.co/spaces/MegaTronX/Subsystem_OS_Command_Access/resolve/a3d0bb6de91a523bfdfd484ab5137349a368dd65/app.py
- Command line
-
hf download hf://spaces/MegaTronX/Subsystem_OS_Command_Access@a3d0bb6de91a523bfdfd484ab5137349a368dd65/app.py
-
curl -L -o app.py https://huggingface.co/spaces/MegaTronX/Subsystem_OS_Command_Access/resolve/a3d0bb6de91a523bfdfd484ab5137349a368dd65/app.py
591 Bytes
| """Talk to spaces VM via subprocess.check_output.""" | |
| # import httpx | |
| import subprocess as sp | |
| from shlex import split | |
| import gradio as gr | |
| def greet(name): | |
| """Probe vm.""" | |
| try: | |
| out = sp.check_output(split(name), encoding="utf8") | |
| except Exception as e: | |
| out = str(e) | |
| # return "Hello " + name + "!!" | |
| return f"[{out}]" | |
| iface = gr.Interface( | |
| fn=greet, | |
| inputs="text", | |
| outputs="text", | |
| title="probe the system", | |
| description="talk to the system via subprocess.check_output ", | |
| ) | |
| # iface.launch(share=True, debug=True) | |
| iface.launch(debug=True) | |