python-launcher 0.2.0

The Python launcher for UNIX
Documentation

The Python Launcher for UNIX

An implementation of the py command for UNIX-based platforms.

The goal is to have py become the cross-platform command that all Python users use when executing a Python interpreter. Not only is it short and to the point, but it also provides a single command that documentation can use in examples which will work regardless of what operating system a user is on. Lastly, it side-steps the "what should the python command point to?" debate by clearly specifying that upfront (i.e. the newest version of Python that is installed).

Search order

py -3.6

  1. Search PATH for python3.6

py -3

  1. Use the PY_PYTHON3 environment variable if defined (e.g. PY_PYTHON3=3.6)
  2. Search PATH for all instances of python3.Y
  3. Find the executable with largest Y

py

  1. Use the PY_PYTHON environment variable if defined (e.g. PY_PYTHON=3) version requested and search accordingly
  2. Search PATH for all instances of pythonX.Y
  3. Find the executable with largest X.Y version

TODO

NOTE: I am using this project to learn Rust, so please don't be offended if I choose to implement something myself instead of accepting a pull request that you submit. (Pull requests to do something I have already implemented in a more idiomatic fashion are very much appreciated, though.)

PEP 397: Python launcher for Windows (documentation)