| import subprocess | |
| import gradio as gr | |
| import time | |
| # Start code-server di background port 8080 | |
| subprocess.Popen([ | |
| "code-server", | |
| "--bind-addr", "0.0.0.0:8080", | |
| "--auth", "none" | |
| ]) | |
| time.sleep(3) | |
| def load_vscode(): | |
| return """ | |
| <iframe src="http://localhost:8080" | |
| width="100%" height="800px" | |
| style="border:none;"> | |
| </iframe> | |
| """ | |
| with gr.Blocks() as demo: | |
| gr.HTML(load_vscode()) | |
| demo.launch(server_name="0.0.0.0", server_port=7860) |