This was taken from the example.py script from the python-nmap program