sys.stdout.flush solves the issue of the restful program seemingly blocking

This commit is contained in:
Crista Lopes
2013-09-25 11:00:16 -07:00
parent 64eaa50383
commit e02996f6e0

View File

@@ -86,6 +86,7 @@ def handle_request(verb, uri, args):
# A very simple client "browser"
def render_and_get_input(state_representation, links):
print state_representation
sys.stdout.flush()
if type(links) is dict: # many possible next states
input = sys.stdin.readline().strip()
if input in links: