How can python help accept a specific port number from a user as input and return all the ips listening on that port on the system. The python script could be running locally on a linux system where this is needed or may access the linux system remotely using an ip specified and needs to get the ip listening on a particular port say. 9223.
Basically it should be similar to a python implementation of netstat -ln | grep port with port being a user input.
Would appreciate any help in this regard.