I am trying to write a two-player Scrabble game in Python using Tkinter and I would like each player to be able to play on a separate computer. But I am not sure how to code this.
Please could someone help me with coding this or point me to a tutorial.
Many thanks in advance.
-
If you wanted to make this app over the internet, you should check out Firebase.mime– mime2020年06月15日 13:52:40 +00:00Commented Jun 15, 2020 at 13:52
-
1Hello radams, this question is a little too broad for users to give you meaningful help. You can look into peer-to-peer or have a server which keeps track of what the players do and communicate actions. This would require a client - server architecture with a REST-Interface. There isnt a definite answer for this, however.c8999c 3f964f64– c8999c 3f964f642020年06月15日 13:57:02 +00:00Commented Jun 15, 2020 at 13:57
2 Answers 2
I'm going to talk about the Connectivity part of the question.
First question is: Is your friend playing from the other side of the world? Or is he connected to the same LAN as you?
- If your friend is on the other side of the world, use Firebase.
- If your friend is on the same LAN or Wi-Fi, use a socket server. That should require a server script and two client scripts, one for each of you.
Next, I'm going to talk about the interface you want to use.
Second question is: Do you want to use a GUI like tkinter or something web-based?
- If you want to use a GUI, use tkinter
- If you want to use something web-based, try flask or web2py
Comments
You could use a similar sort of architecture as a chat app, see for example this link for a simple example.
You would probably want your server to store the state of the game, and keep copies on either client side, to be updated as the game progresses.
If you want to have something that works over the web, you might want to look into using a Flask based setup, which is sometimes easier to deal with.