Picking Python 2 or Python 3 from Command Prompt in Windows

Switch between Python 2 and Python3 in Windows just like Linux

  1. create a file C:\Anaconda\python3.bat containing:
    c:\Anaconda3\python %*
    
  2. pick Python 2 or 3 from Windows Command Prompt
    python blah.py
    
    python3 blah.py
    

Leave a Comment