当我在 Windows 10 上编程时,我通常使用 linux 子系统,所以我所有的路径都相对于~. 我有一个 python 脚本,它在后台永远运行,直到我终止进程。如果没有打开的终端,我将如何在 Windows 10 bash 上做到这一点?
我尝试过的事情:
bash -c "python3 script.py 从运行。nohup python3 -u script.py 然后关闭终端。setsid python3 script.py 然后关闭终端。这些都没有奏效。有没有办法做到这一点?或者,如果我从 W10 和 bash 运行脚本而不必每次都切换它们,是否有办法更改路径以便它们工作?