Showing posts with label py. Show all posts
Showing posts with label py. Show all posts

Monday, April 8, 2013

py, the Python Launcher for Windows

By Vasudev Ram

py, or py.exe, is the name of a new(ish) Python Launcher for Windows, which was released as part of Python 3.x.

This is the PEP for py.

I tried out Py and it worked okay, for some basic uses.

It lets you launch a specific version of Python, either 2, or 3, or 2.x or 3.x. I tried using it to launch both Python 2.7.3 and Python 3.3.1.

Examples:
C:\> py -V
Python 2.7.3
C:\> py -3 -V
Python 3.3.1
c:\Python33\Tools\Scripts> py -2 which.py py.exe
C:\Windows\py.exe
c:\Python33\Tools\Scripts>py -2 which.py cmd.exe
C:\Windows\system32\cmd.exe

Here is the partial output of running the py --help command:
c:\Python33\Tools\Scripts>py --help
Python Launcher for Windows Version 3.3.1150.1013

usage: py [ launcher-arguments ] script [ script-arguments ]

Launcher arguments:

-2     : Launch the latest Python 2.x version
-3     : Launch the latest Python 3.x version
-X.Y   : Launch the specified Python version
-X.Y-32: Launch the specified 32bit Python version

- Vasudev Ram - Dancing Bison Enterprises