modify print statement Closes #12
Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/commit/1339f59a Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/tree/1339f59a Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/diff/1339f59a Branch: refs/heads/master Commit: 1339f59aa159b43942fd7bed9d6b70adc5947628 Parents: 77afa84 Author: Shinsuke Sugaya <[email protected]> Authored: Wed May 3 10:41:32 2017 -0700 Committer: Donald Szeto <[email protected]> Committed: Wed May 3 10:41:32 2017 -0700 ---------------------------------------------------------------------- data/import_eventserver.py | 6 +++--- data/send_query.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/blob/1339f59a/data/import_eventserver.py ---------------------------------------------------------------------- diff --git a/data/import_eventserver.py b/data/import_eventserver.py index 0a1e109..2c92335 100644 --- a/data/import_eventserver.py +++ b/data/import_eventserver.py @@ -13,7 +13,7 @@ def import_events(client, file): f = open(file, 'r') random.seed(SEED) count = 0 - print "Importing data..." + print("Importing data...") for line in f: data = line.rstrip('\r\n').split(RATE_ACTIONS_DELIMITER) # For demonstration purpose, randomly mix in some buy events @@ -36,7 +36,7 @@ def import_events(client, file): ) count += 1 f.close() - print "%s events are imported." % count + print("%s events are imported." % count) if __name__ == '__main__': parser = argparse.ArgumentParser( @@ -46,7 +46,7 @@ if __name__ == '__main__': parser.add_argument('--file', default="./data/sample_movielens_data.txt") args = parser.parse_args() - print args + print(args) client = predictionio.EventClient( access_key=args.access_key, http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-recommender/blob/1339f59a/data/send_query.py ---------------------------------------------------------------------- diff --git a/data/send_query.py b/data/send_query.py index 7eaf53e..3dafd6d 100644 --- a/data/send_query.py +++ b/data/send_query.py @@ -4,4 +4,4 @@ Send sample query to prediction engine import predictionio engine_client = predictionio.EngineClient(url="http://localhost:8000") -print engine_client.send_query({"user": "1", "num": 4}) +print(engine_client.send_query({"user": "1", "num": 4}))
