migrate ns-3 to Python 3

We now have a major Linux release (Ubuntu 18.10) that does not ship with Python 2 provided by default, and that does not support the shebang default interpreter #!/usr/bin/env python. Installing Python 2 is one solution, but considering that Python 2 is scheduled for end of life in 2020, we should instead take steps to fully migrate to Python 3.

I propose the following changes:

  1. in the ns-3-allinone, ns-3-dev, and bake repositories, replace python with python3 in the shebang line of Python programs

  2. Waf uses python shebang, so I propose to move the waf binary to a file corresponding to its version (e.g. waf-2.0.9) and to add the following bash script as an executable named 'waf':

#!/usr/bin/env bash
python3 ./waf-2.0.9 "$@"

(as suggested in this Waf issue: https://gitlab.com/ita1024/waf/issues/1856)

  1. Change our documentation and installation wiki page to refer to python3 in place of python.

  2. Run full CI tests on a buildslave that lacks Python 2.

Are there any other changes needed?

Edited by Tom Henderson