I need tips for projecting a python server without blocking GUI

In general, I need some learning material about how to program softwares composed of various parts: how to put everything together and working great while keeping it encapsulated.

My specific case is: I'm trying to program a simple group messenger in python, for learning purposes. It will have a GUI that gives access to hosting your own server or joining one. The code I actually have done is a simple echo server and client, and a simple GUI window with a chat box, entry box and user list, each one working independently as a python package.

The actual problem is how to put the server, the client and the GUI working together smoothly, without the socket "access()" blocking the GUI updates. Probably threads will be necessary, but I don't know how to add it in this context.

Thanks in advance!


What you want is a main event loop.

What I would suggest in terms of resources is having a look at the Tornado source code and figure out what they are doing. You will be writing something very similar except you will be waiting on GUI events as well.

Need Your Help

Do I need to Separate Business Objects and Business Logic? Asp.net MVC with Repository Pattern in C#

c# asp.net asp.net-mvc repository

I'm having trouble finding an answer to this. Basically, right now I have these layers:

Get hold of redirect url with Java org.apache.http.client

java post redirect httpclient

I need help with figuring out how to get hold of the redirect after I make a post to the server.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.