I need to make a chess multi-player game that works over the internet. I am a beginner to programming and networking alike, although I have managed the GUI based chess platform. Now I need to overcome the challenge of configuring the game over the internet. In order to do that, I would like to use a third party application or software (anything but socket programming) to make the python programs running on two machines talk to each other. What I am hoping to do is, that whenever someone makes a move, I want to send a string/list of the updated coordinates of his/her chess pieces over the internet to the second player, so that he can see what move has been made. Can anyone please tell where to start from or what to read regarding the same? Is the idea of sending the updated string/ list of coordinates feasable using an open source chat utility like telepathy?
-
2Not really a fit for an SO question - it's too broad to be answerable, or failing that asks for opinions. Your best bet is to find an existing open source multi-player chess program (or in fact - any open source app. messenger apps is probably not a bad idea) and see how that does it... then look at others, and use those as an ideas base to look at technologies/related information to further your understanding – Jon Clements Nov 06 '13 at 15:07
-
Listen, you can't make two computers communicate over the internet without one being a server.. Especially for complex communication like games. – aIKid Nov 06 '13 at 15:14
-
@JonClements: what exactly is an SO question? (sorry i am a noob) – Srij Nov 06 '13 at 16:09
-
@Srij SO = Stackoverflow and Question = what you just asked :) – Jon Clements Nov 06 '13 at 16:11
3 Answers
You'd want to use the socket module. Example programs. It really isn't so difficult to use socket, basically the server end has to bind()
, listen()
, then accept()
and the client has to simply connect()
. From there recv()
and sendall()
can be used to receive and send data respectively. If you really don't want to use socket
, then you could use a chat protocol like IRC or XMPP.

- 4,033
- 2
- 24
- 44
-
2Sockets would be appropriate, but it seems clear from the OP that he wants `anything but socket programming`. – hexparrot Nov 06 '13 at 15:13
-
A chat/IM solution seems like a fine idea.
For chat/IM, you could use Jabber/XMPP. You would either need to set up your own server or find someone hosting one for the public. Setting up a Jabber server is fairly easy, you can use OpenFire for example. For connecting to Jabber, you could use python xmpp libraries to send and receive the messages. This might be the simplest approach because the Jabber libraries tend to be very easy to use. (I've done it in Java and .NET, not python, though).
Another approach would be to use something like twitter messaging. See Python Twitter library: which one? for a recommendation for a library which supports direct messaging (which is what you need). The advantage of this, is that once you learn the twitter API, you don't need your own server.

- 1
- 1

- 6,711
- 8
- 52
- 85
This is a broad, opinionated question but my go-to network communication protocol in Python is Twisted's Perspective Broker. It's event driven, kind of complicated to setup and requires control of the program's event loop but it works great. It allows for two-way communication between the client and server, and has the convenience of remote objects.

- 18,820
- 42
- 108
- 144