import urllib.request
import json
import sys

ip = "localhost";
id = 1;

def addReading(id, value):
    response = urllib.request.urlopen("http://" + ip + "/smartschool/addReading.php?id=" + str(id) + "&value=" + str(value)).read();
    return true;

def getReading(id):
    response = urllib.request.urlopen("http://" + ip + "/smartschool/getReading.php?id=" + str(id)).read();
    data = json.loads(response);
    return data.value;

import urllib.request
import json
import sys

ip = "localhost";

def addReading(id, value):
    response = urllib.request.urlopen("http://" + ip + "/smartschool/addReading.php?id=" + str(id) + "&value=" + str(value)).read();
    return true;

def getReading(id):
    response = urllib.request.urlopen("http://" + ip + "/smartschool/getReading.php?id=" + str(id)).read();
    data = json.loads(response);
    return data.value;

Remove id variable