prad / app.py
prad9036
app.py
15dcf8f
Raw History Blame Contribute Delete
699 Bytes
import os
import subprocess
import gradio as gr
def start_gotty():
if not os.path.exists("gotty"):
subprocess.run(
"curl -L https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz | tar -xz",
shell=True,
check=True
)
os.chmod("gotty", 0o755)
os.environ["TERM"] = "xterm-256color"
subprocess.Popen([
"./gotty",
"-w",
"-p", "8080",
"-c", "pradeepydv:prdp1234",
"bash"
])
start_gotty()
def ui():
return "GoTTY running. Open the terminal at /"
demo = gr.Interface(fn=ui, inputs=[], outputs="text")
demo.launch(server_name="0.0.0.0", server_port=7860)