python: add rewrite function for generic shebangs
python: add rewrite function for generic shebangs

From PEP 394
https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers

In cases where the script is expected to be executed outside virtual environments,
developers will need to be aware of the following discrepancies across platforms and installation methods:

Older Linux distributions will provide a python command that refers to Python 2, and will likely not provide a python2 command.
Some newer Linux distributions will provide a python command that refers to Python 3.
Some Linux distributions will not provide a python command at all by default, but will provide a python3 command by default.

When potentially targeting these environments, developers may either use a Python package installation tool that rewrites shebang lines
for the installed environment, provide instructions on updating shebang lines interactively,
or else use more specific shebang lines that are tailored to the target environment.

konqui/brew,EricFromCanada/brew,reitermarkus/brew,konqui/brew,mahori/brew,JCount/brew,nandub/brew,nandub/brew,mahori/brew,claui/brew,JCount/brew,Homebrew/brew,vitorgalvao/brew,claui/brew,konqui/brew,Homebrew/brew,MikeMcQuaid/brew,MikeMcQuaid/brew,Homebrew/brew,Homebrew/brew,EricFromCanada/brew,sjackman/homebrew,EricFromCanada/brew,claui/brew,sjackman/homebrew,nandub/brew,MikeMcQuaid/brew,MikeMcQuaid/brew,claui/brew,reitermarkus/brew,JCount/brew,konqui/brew,JCount/brew,vitorgalvao/brew,sjackman/homebrew,reitermarkus/brew,mahori/brew,reitermarkus/brew,vitorgalvao/brew,mahori/brew,EricFromCanada/brew,sjackman/homebrew,vitorgalvao/brew,nandub/brew