steven meier <commercial...@yahoo.de> writes:

> if __name__ == '__main__':
>     import qt5reactor
>     qt5reactor.install()
>     from twisted.internet import reactor
>     reactor.callWhenRunning(print_it, reactor)
>     reactor.run()

For "client-style" things (I guess I just mean "something that exits"),
there's even a utility function that calls some method you provide with
the reactor as the first argument, and arranges for reactor.stop() to
get called exactly once (when the Deferred returned by your method
fires).

    import qt5reactor
    qt5reactor.install()
    from twisted.internet.task import react

    if __name__ == '__main__':
        react(print_it)

-- 
meejah

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to