I programmed a port scanning module which you can download here http://code.google.com/p/portscan/
Including the module in your program allows you to scan specific ports in an IP, using the function scan(ip,port,timeout). Instead of getting a cryptic code in return, the function will return "open", "closed", "filtered", or "timeout". It's a great way of learning about port scanning with Python -- http://mail.python.org/mailman/listinfo/python-list