From e93b91e0c55e5ed4193bd7750e28533002e4d58b Mon Sep 17 00:00:00 2001 From: Muhamad Irfan Maulana <13515037@std.stei.itb.ac.id> Date: Wed, 11 Apr 2018 12:41:58 +0700 Subject: [PATCH] add test connection --- src/python/test.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/python/test.py diff --git a/src/python/test.py b/src/python/test.py new file mode 100644 index 0000000..3e434d7 --- /dev/null +++ b/src/python/test.py @@ -0,0 +1,8 @@ +import serial, struct, time, urllib.request, json + +with urllib.request.urlopen("http://localhost/api-greentyno/getStatus.php?id=1") as url: + data = json.loads(url.read().decode()) + +print(data) +year = data['year'] +print(year) -- GitLab