A python server

Peter Hansen peter at engcorp.com
Mon Apr 14 18:16:18 CEST 2003


dansan wrote:
> 
> I'm trying to write a little server that will allow connections via
[snip]
> I guess I'm having dificult with the higher-level desing of such a
> system.  Right now my desing is very primitive, and has a LOT of
> issues:
> 
>  # start
>  # loop-waiting-for-connections (can't break out of this from cli yet)
>  # make tournament schedule
>  # run-games
> 
> I have program in other programming languages before, and lately I've
> been doing some python.  So far I have enjoyed it a lot, so I wanted
> to give this project a try in py.  Any help would be greatly
> appreciated, in higher level desing as well as in lower-level code
> snippets.  URL to documentation are also invaluable :)

I believe the best advice for you at this stage might be the
now-ubiquitous "Twisted does that".  Although at your level 
figuring out how to work with Twisted (http://www.twistedmatrix.com)
might be non-trivial, it's a certainty that rolling it yourself at
a lower level (i.e. sockets) is going to be much harder.

Five or ten lines of code on top of Twisted (and there are lots
of good examples and How-Tos at that web site) is enough to get
you past the socket issues, at which point the job is entirely in
your hands to program the tournament scheduling parts, the
"run games" part, etc.... in other words, it will let you focus
on the application logic itself, and not on the infrastructure.

-Peter




More information about the Python-list mailing list