How do I get the ports that a process is listening on using python? The pid of the process is known.

Edit
Report