Blocking a network port with Python
===

I need a code that would block certain network ports. So first I need to detect which ports a program uses. And then block those ports. So let's say, for a browser the code should block only port 80. How do I do it? Is there already a handy python library exist?

Appreciate any help/advice.
