Schedule a Python script via batch on windows (using Anaconda)

后端 未结 4 1723
别跟我提以往
别跟我提以往 2020-12-09 04:29

I have a script that i run every day and want to make a schedule for it, i have already tried a batch file with:

start C:\\Users\\name\\Miniconda3\\python.exe

4条回答
  •  孤街浪徒
    2020-12-09 04:49

    I had a similar problem a few days ago. What I discovered is that anaconda prompt is nothing but your usual cmd prompt after running an 'activate.bat' script which is located in the anaconda 'Scripts' folder. So to run your python scripts in anaconda all you need to do is write 2 lines in a batch file. (Open notepad and write the lines mentioned below. Save the file with .bat extension)

    1. call C:\....path to anaconda3\Scripts\activate.bat
    2. call python C:\path to your script\Script.py

    Then you schedule this batch file to run as you wish and it will run without problems.

提交回复
热议问题