如何使用Anaconda在后台运行python脚本?(';nohup python-u test.py';不起作用!)
我有一个简单的python脚本test.py:如何使用Anaconda在后台运行python脚本?(';nohup python-u test.py';不起作用!),python,windows,anaconda,git-bash,Python,Windows,Anaconda,Git Bash,我有一个简单的python脚本test.py: import time import logging logging.basicConfig(filename='app.log', filemode='w', level=logging.DEBUG) i=0 while i<100: i+=1 logging.info(i) print(i) time.sleep(1) 用于运行脚本的终端:Git,版本:2.29.2.windows.3在运行脚本之前在
import time
import logging
logging.basicConfig(filename='app.log', filemode='w', level=logging.DEBUG)
i=0
while i<100:
i+=1
logging.info(i)
print(i)
time.sleep(1)
用于运行脚本的终端:Git,版本:2.29.2.windows.3在运行脚本之前在终端窗口中激活base 窗口:
conda activate base
python test.py
Mac:
谢谢你的回答。你能详细说明你的答案吗。或者你可以附上文档的链接。答案不起作用@SyedAfsahulHaque您是否尝试过在Anaconda提示符下运行python文件?在文件名抛出error here.python test.py(不要添加任何其他内容)后,Yaa,“&”。
conda activate base
python test.py
source activate base
python test.py