Skip to content

Instantly share code, notes, and snippets.

@msr1k
Last active February 1, 2018 04:23
Show Gist options
  • Save msr1k/1ccf78f92486c1318bd6679ac723e8f8 to your computer and use it in GitHub Desktop.
Save msr1k/1ccf78f92486c1318bd6679ac723e8f8 to your computer and use it in GitHub Desktop.
Example batch file which invokes anaconda prompt and execute python script (Windows)
@FOR /F "delims=" %%i IN ('@call "C:\Users\%USERNAME%\AppData\Local\Continuum\Anaconda3\Scripts\conda.exe" ..activate "cmd.exe" %1') DO @SET "NEW_PATH=%%i"
@SET PATH=%NEW_PATH%;%PATH%
python %2
@cd /d %~dp0
@if not EXIST anaenv (
@echo Please create anaenv file which written your anaconda environment name
@pause
@exit 1
)
@set /p ANAENV=<anaenv
@cmd.exe /K anapy.bat %ANAENV% Application.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment