py-hello-world

It’s a simple hello world example of an installable command line Python application.

You can install it and run in console some commands (py-hello-world, py-hello-world-i, py-hello-world-sub).

Also, it has optional command line argument -t/--trace. With it the program logs package’s and function’s calls. It almost makes no sense, but it’s only just an example usage of command line arguments.

Also, it uses termcolor as a dependency to make this example more practical. This external lib just makes the console output colored.


Installation

Note: Python installed is required. Don’t forget to check “Add to PATH” while installing.

pip install https://github.com/AlttiRi/py-hello-world/archive/master.tar.gz

Or, if you have also Git installed:

pip install git+https://github.com/AlttiRi/py-hello-world.git

Dev Installation (from GH)

git clone https://github.com/AlttiRi/py-hello-world.git
cd py-hello-world
python setup.py develop

Dev Installation (local)

python setup.py develop

Or, the alternative command with the less verbose output:

pip install --editable .

-e, --editable for “editable” installing.


Scripts

After installing, you can run the follow scripts in a console in any place.

py-hello-world
py-hello-world-wi
py-hello-world-sub

The same, but with -t, --trace command line argument:

py-hello-world -t
py-hello-world-wi --trace
py-hello-world-sub --trace

Also, it has -h, --help and --version:

py-hello-world -h
py-hello-world --help
py-hello-world --version

Working with command line arguments is implemented using the argparse module.


UnInstallation

pip uninstall py-hello-world -y

With dependencies:

pip uninstall py-hello-world termcolor -y

Dependencies

Manual installing:

pip install termcolor

Uninstalling:

pip uninstall termcolor -y

Updating

Usually just use the same command as for installing.

To install a updated version (with changes in the repo’s code), but which still has not updated version number, use --ignore-installed. For example:

pip install --ignore-installed --no-deps https://github.com/AlttiRi/py-hello-world/archive/master.tar.gz

--no-deps in this case is recommended in order to do not re-install the dependecies.