python-launcher 0.1.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 is 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. Search PATH for all instances of python3.Y
  2. Find the executable with largest Y

py

  1. Search PATH for all instances of pythonX.Y
  2. Find the executable with largest X.Y version

TODO

PEP 397: Python launcher for Windows (documentation)

  • Specifying the version
    • Environment variables
  • Shebang line parsing
  • py -0
    • Output well-formatted JSON to start in order for it to be consumable?
    • Output column format like pip list?
  • py -h emits its own help before continuing on to call python
  • Configuration files
    • Customized commands
    • Want a better format like TOML?
    • Want to use Pipfile and its python_version field?
    • Probably want a way to override things, e.g. wanting a framework build on macOS somehow
      • Aliasing? E.g. 2.7-framework=/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python?
      • Just provide a way to specify a specific interpreter for a specific version? E.g. 2.7=/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python