EvilZone
Programming and Scripting => Scripting Languages => : Ragehottie June 11, 2012, 12:08:13 AM
-
I am working on a minecraft server wrapper and I just need something so I can constantly input commands and constantly get the output for commands/other things. Any help would be awesome.
-
while(1):
var = raw_input("User input: ")
print "User input is: ", var
Does that help?
-
No, because it might need to output something before it gets input or vice versa
-
I seem to not understand the phenomenon of writing something to output which relies on the input, BEFORE getting the input. Either that, or you need something like threads? One for writing the output based on previous calculations that include the last input and another for getting the input whenever you need it.
-
while(1):
if need_to_output:
print output
var = raw_input("User input: ")
print "User input is: ", var
?
-
while(1):
if need_to_output:
print output
var = raw_input("User input: ")
print "User input is: ", var
?
Kinda. But I need it to not get hung on getting the input. I think I need to use threads maybe?
-
Kinda. But I need it to not get hung on getting the input. I think I need to use threads maybe?
Yeah you need to use threads. One thread changes the map the other one listens for user input.
-
Kinda. But I need it to not get hung on getting the input. I think I need to use threads maybe?
That hung up is called blocking. You will need threads. Internet protocols can also block, so without knowing more information of what your wanting to do, I will suggest threading.