issue where subprocess not inheriting virtual env

see SO python-subprocess-doesnt-inherit-virtual-environment
This commit is contained in:
onyx-and-iris 2023-07-04 19:51:23 +01:00
parent 10dbf63056
commit f6d92d1c34

View File

@ -1,20 +1,21 @@
import subprocess import subprocess
import sys
from pathlib import Path from pathlib import Path
def ex_gui(): def ex_gui():
path = Path.cwd() / "examples" / "gui" / "." scriptpath = Path.cwd() / "examples" / "gui" / "."
subprocess.run(["py", str(path)]) subprocess.run([sys.executable, str(scriptpath)])
def ex_obs(): def ex_obs():
path = Path.cwd() / "examples" / "obs" / "." scriptpath = Path.cwd() / "examples" / "obs" / "."
subprocess.run(["py", str(path)]) subprocess.run([sys.executable, str(scriptpath)])
def ex_observer(): def ex_observer():
path = Path.cwd() / "examples" / "observer" / "." scriptpath = Path.cwd() / "examples" / "observer" / "."
subprocess.run(["py", str(path)]) subprocess.run([sys.executable, str(scriptpath)])
def test(): def test():