0

I am working on a project for which I want multiple users who are in the same intranet should be able to share a running python command-line session. This is like a game where everyone can play a multiplier game. I want the whole memory to take for the session to be on the heap (ram) only. I don't want any of the data to be stored in the DB or filesystem, so that once the game finished of data will be there about it.

1 Answers1

1

You can use socket model to do it:

Socket Std Lib

Your create server which licten to incomming connectiobn and do the main logic. So generally speaking there are several client scripts and one server script. To listen to clients create separate thread/threads

I can share example of messenger program, you can fork it and use as example Messenger

Another choice is to create Flask http server, create get/post API there, clients will be able to send requests to server and get appropriate responses.

Artiom Kozyrev
  • 3,526
  • 2
  • 13
  • 31