views:

506

answers:

2

I'm working on a small utility application in Python.

The networking is gonna send and recieve messages. The GUI is gonna display the messages from the GUI and provide user input for entering messages to be sent. There's also a storage part as I call it, which is gonna get all the network messages and save them in some kind of database to provide some kind of search later.

What my question is, what would be the best way to desing this? For sure all them have to happen in saperate threads, but what I'm wondering is how to pass information between them the best way? What kind of signal passing / thread locking available in Python should I use to avoid possible problems?

+1  A: 

I think that you could use a Queue for passing messages between the GUI and the network threads.

As for GUI and threads in general, you might find the PyGTK and Threading article interesting.

Cristian Ciupitu
+2  A: 

One, probably the best, solution for this problem is to use Twisted. It supports all the GUI toolkits.

Ali A