import socket


def port_open(port):
    """Return True if given port is already open in localhost.
       Return False otherwise."""
    sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    return (sck.connect_ex(('127.0.0.1', port)) == 0)