0

可能重复:
启动 python 子进程具有不同的行为,具体取决于启动器

Python 父进程如何影响 Python 子进程?

我有一个 Python 脚本,它通过这样的os.system调用(script1.py)调用另一个 Python 解释器:

os.system("C:\path\batch_file_that_starts_up_python.bat C:\pathtoother\script2.py")

script1.py在命令行运行时,script2.py加载正常。script1.py在 GUI 中运行时script2.py无法加载 dll。

sys.path在命令行或 GUI 中运行时具有相同的值。

我的调用方案的详细信息在这个问题中:Launching python subprocess has different behavior based on launcher`

4

0 回答 0