A simple port scanner program written in Python using the standard library
Scan all ports from 1 to 65535 on localhost
$ python portscan.py
Scan all ports from 1 to 65535 on host google.com
$ python portscan.py -H google.com
Scan ports 80 and 443 on host httpbin.org
$ python portscan.py -H httpbin.org -p 80,443
Scan ports from 22-31337 on host scanme.nmap.org
$ python portscan.py -H scanme.nmap.org -p 22-31337
Scan port 25565 on host mc.hypixel.net
$ python portscan.py -H mc.hypixel.net -p 25565
This script is compatible with Python versions 3.6 and up
It has been tested working on 3.10.1