效果
bat文件
run.bat
@echo off
call C:\ProgramData\Anaconda3\Scripts\activate.bat pytorch
C:\ProgramData\Anaconda3\envs\pytorch\python.exe E:\Gerapy_py\gerapy\projects\xmtv\xmtv\start_urls.py
下面这个bat文件可以用来判断py文件是否执行成功
@echo off
call C:\ProgramData\Anaconda3\Scripts\activate.bat pytorch
C:\ProgramData\Anaconda3\envs\pytorch\python.exe E:\Gerapy_py\gerapy\projects\xmtv\xmtv\start_urls.py
IF %ERRORLEVEL% EQU 0 (
echo ok
) ELSE (
echo nook
)
pause