From e02996f6e063b424551e008037c5ccd287ab16f2 Mon Sep 17 00:00:00 2001 From: Crista Lopes Date: Wed, 25 Sep 2013 11:00:16 -0700 Subject: [PATCH] sys.stdout.flush solves the issue of the restful program seemingly blocking --- 15-restful/tf-15.py | 1 + 1 file changed, 1 insertion(+) diff --git a/15-restful/tf-15.py b/15-restful/tf-15.py index 19e9b49..e8554be 100755 --- a/15-restful/tf-15.py +++ b/15-restful/tf-15.py @@ -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: