# Python example

This is a small Python 3 program that shows how to query a running Hawk server using the Python client stubs generated by [Apache Thrift](https://thrift.apache.org).

## Running from a Bash shell

You can run the `countInstances.sh` script, provided the following:

* You are inside a Bash shell (included in Linux/MacOS, and available via the Git Bash tool that comes with [Git](https://git-scm.com/) on Windows).
* You have [virtualenv](https://virtualenv.pypa.io/en/latest/) installed and the `virtualenv` command is in your PATH.

## Running from Python

You will need to have the Python client libraries for the Hawk Thrift API in your `PYTHONPATH`.
You can download these from the [Eclipse Hawk website](https://www.eclipse.org/hawk/).

You will also need to have the [`thrift`](https://pypi.org/project/thrift/) PyPI module installed, e.g. by running this:

```shell
pip install thrift
```

You can then run the `countInstances.py` script directly, without using the `countInstances.sh` script.
