Skip to content

Instantly share code, notes, and snippets.

@phdesign
Created October 16, 2018 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phdesign/f53fb737bb85fc6fe15234ebd57e868e to your computer and use it in GitHub Desktop.
Save phdesign/f53fb737bb85fc6fe15234ebd57e868e to your computer and use it in GitHub Desktop.
Python on Windows
rem Place this in C:\Python27\python2.bat
@echo off
set OLDPATH=%PATH%
path C:\Python27;%PATH%
python.exe %*
path %OLDPATH%
rem Place this in C:\Python37\python3.bat
@echo off
set OLDPATH=%PATH%
path C:\Python37;%PATH%
python.exe %*
path %OLDPATH%
@phdesign
Copy link
Author

Assuming both C:\Python27 and C:\Python37 are on PATH, you can now use python2 or python3 to start the correct version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment