def install():
    """
    Configure the Twisted mainloop to be run inside the gtk3+ mainloop.
    """
    if runtime.platform.getType() == 'posix':
        reactor = Gtk3Reactor()
    else:
        reactor = PortableGtk3Reactor()

    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor

    Configure the Twisted mainloop to be run inside the gtk3+ mainloop.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/gtk3reactor.py