[Twisted-Python] how to change an qt4 applicaion using twisted?

Daniel Sank sank.daniel at gmail.com
Sun Nov 17 10:01:33 MST 2013


Yangyouxiu,

I can definitely help you with this as I've recently written a chat
server/client with twisted+PyQt4 and am working on a more complex
program that uses PyQt4 with twisted's perspective broker.

I have attached five files:

1. client-pyqtreactor.py is a chat client using pyqtreactor and PyQt4.
2. ui.ui is the user interface file loaded by client-pyqtreactor.py
3. server.py is a chat server using asyncore. Note that the server
need not use PyQt4 as it has no GUI.
4. constants.py contains configuration data for the client and server
5. qt4reactor.py is the custom reactor

Put these all in the same directory, then run the server, then run
some clients. When the client window appears click "connect" and then
you can use it just like any other network chat program.

I hope this helps, and if anyone has suggestions on how to improve the
client code please tell me, as I intend on using it as part of a
tutorial on twsited+PyQt4.

Danie Sank
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client-pyqtreactor.py
Type: application/binary
Size: 3136 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131117/dc3c1da8/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: constants.py
Type: application/binary
Size: 60 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131117/dc3c1da8/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt4reactor.py
Type: application/binary
Size: 7686 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131117/dc3c1da8/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: server.py
Type: application/binary
Size: 2260 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131117/dc3c1da8/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ui.ui
Type: application/octet-stream
Size: 2144 bytes
Desc: not available
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131117/dc3c1da8/attachment-0001.obj>


More information about the Twisted-Python mailing list