sys.stdout.flush solves the issue of the restful program seemingly blocking
This commit is contained in:
@@ -86,6 +86,7 @@ def handle_request(verb, uri, args):
|
|||||||
# A very simple client "browser"
|
# A very simple client "browser"
|
||||||
def render_and_get_input(state_representation, links):
|
def render_and_get_input(state_representation, links):
|
||||||
print state_representation
|
print state_representation
|
||||||
|
sys.stdout.flush()
|
||||||
if type(links) is dict: # many possible next states
|
if type(links) is dict: # many possible next states
|
||||||
input = sys.stdin.readline().strip()
|
input = sys.stdin.readline().strip()
|
||||||
if input in links:
|
if input in links:
|
||||||
|
|||||||
Reference in New Issue
Block a user