# app.py import os import subprocess import time import gradio as gr # Start Jupyter notebook server in the background subprocess.Popen(["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.password=''", "--NotebookApp.allow_origin='*'", "--NotebookApp.disable_check_xsrf=True"]) # Give Jupyter time to start before creating the Gradio interface time.sleep(5) # Create a simple Gradio interface that embeds Jupyter demo = gr.Interface( fn=lambda: None, inputs=[], outputs=gr.HTML('''

Jupyter Notebook

Mobile-friendly notebook environment

'''), title="Jupyter Notebook Environment", css="body, .gradio-container {min-height: 0 !important; padding: 0 !important;}" ) # Launch the Gradio app on port 7860 demo.launch(server_port=7860)