def define(host, port, database, word):
    """Look up a word using a dict server"""
    d = defer.Deferred()
    factory = DictLookupFactory("define", (database, word), d)

    from twisted.internet import reactor
    reactor.connectTCP(host, port, factory)
    return d
Look up a word using a dict server
stackoverflow/venv/lib/python3.6/site-packages/twisted/protocols/dict.py