Python Forum
Alternative for input() suitable for servers
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alternative for input() suitable for servers
#4
I'm not sure what is not understandable with "server". For me a server is a server. I don't know how to explain that better, but i'll give it a try:
So the server i have, hosted on my own pc for now, has to become a login server for clients( made in gamemaker).

People can registrate on my website to create an account. The client can use that account to login on the server, that will verify that account. Account data is stored in the database.
I also want to add some extra features to the server, like a chatbox, friendlist. More important, i also want to be able to use commands (self made commands) in the console. But to read some input from the console i usually use input(). Alas input() is also blocking, so the server freezes all activity untill it gets that input(). Ofcourse i do not want it to freeze. I create a new thread for each client, wich works fine (i think), i also create a thread for the server itself (for sending commands or if sending customized messages)but then again input() just freezes the whole program. So here i am to ask advice or an alternative solution to be able to read input without freezing the whole program.
I am used to program in gamemaker studio 2 (GMS2), GMS2 has a builtin variable "keyboard_string". This variable returns keyboard input and you can reset it or empty it just by doing keyboard_string = "" Simple as that. I couldn't find anything like that in python. I googled alot but i can only find amazing complex solutions wich do not work either (or i'm doing something wrong)


I hope it is understandable now Tongue
Reply


Messages In This Thread
RE: Alternative for input() suitable for servers - by winnetrie - Jan-05-2019, 01:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Twilio alternative jmair 3 3,946 Feb-08-2024, 01:55 PM
Last Post: Sharmi
  Pillow alternative? kucingkembar 4 924 Jul-27-2023, 10:50 AM
Last Post: Larz60+
  how to manage crypto trading flooding data from exchange servers Mikeardy 0 1,259 Dec-26-2021, 08:31 PM
Last Post: Mikeardy
  Help for the shortest way to install a suitable version of Python, Numpy, and OpenCV. Ezzat 2 2,330 Dec-23-2021, 12:34 PM
Last Post: snippsat
  Improves performance on socket multi-threaded servers for object detection pennant 1 1,940 Aug-31-2021, 08:43 AM
Last Post: Larz60+
  suitable libraries for project dogbural 0 1,457 Dec-29-2020, 12:38 PM
Last Post: dogbural
  Alternative for Cairosvg? Maryan 0 2,484 Oct-26-2020, 01:27 PM
Last Post: Maryan
  Create a directory structure across many servers metro17 1 1,779 Nov-05-2019, 03:35 PM
Last Post: Larz60+
  OOP and module approaches in a simple app monitoring list of servers hjzxxzjcz 1 52,681 Nov-01-2019, 04:30 PM
Last Post: nilamo
  another alternative to np.interp evelynow 1 2,959 Aug-22-2019, 03:32 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020