import socket


def port_open(host, port):
    """
    port_open: determines if the port is open
        host: the addr of machine you wish to figure out
        port: the port number you want to try to connect to
    return: (bool)
    """
    s = socket.socket() #creating a socket object 

    # Does error handling to figure out the port is open or closed.
    try:
        s.connect((host, port))
    except:
        return False
    else:
        return True