File size: 646 Bytes
0e958c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43ca3cb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import threading
import subprocess

def run_streamlit():
    subprocess.run([
        "streamlit", "run", "./src/streamlit_app.py",
        "--server.port", "8501",
    ])

def run_static_files():
    subprocess.run(
        ["cd static && npx http-server"],
        shell=True
    )

if __name__ == "__main__":
    # Start both servers in separate threads
    streamlit_thread = threading.Thread(target=run_streamlit)
    static_files_thread = threading.Thread(target=run_static_files)

    streamlit_thread.start()
    static_files_thread.start()

    # Wait for both servers to finish
    streamlit_thread.join()
    static_files_thread.join()