From b401286d0534e9cea1634ddb53ae4a9158e5b6a2 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 28 Mar 2023 09:15:10 +0200 Subject: [PATCH] dont chdir, but construct the path --- stand.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/stand.py b/stand.py index d2c4aef..78e37b0 100755 --- a/stand.py +++ b/stand.py @@ -36,12 +36,11 @@ cherrypy_params = f""" import sys -import os -# cd to the folder that contains this script +# combine the folder that contains this script -base = sys.path[0] -os.chdir(base) +base = sys.path[0] or "." +script = f"{base}/stand/webapp.py" import subprocess @@ -52,7 +51,7 @@ import subprocess cmd = [ # "echo", - "streamlit", "run", *streamlit_params, "stand/webapp.py", + "streamlit", "run", *streamlit_params, script, "--", *cherrypy_params ]