Oct-01-2016, 11:42 AM
I have some code getting the position of the ISS from http://api.open-notify.org/iss-now.json
Each time I run the code I get new values - exactly as expected. But if I repeat the call (with a sleep of 15 seconds) it gets the same value each time.
Each time I run the code I get new values - exactly as expected. But if I repeat the call (with a sleep of 15 seconds) it gets the same value each time.
def plotiss(isstoplot): url = 'http://api.open-notify.org/iss-now.json' request=urllib.request.urlopen(url) response=request.read() result=json.loads(response) location = result['iss_position'] newlat = location['latitude'] newlon = location['longitude'] print('Latitude: ', newlat) print('Longitude: ', newlon) # isstoplot is a turtle isstoplot.goto(newlon, newlat) plotiss(iss) time.sleep(15) plotiss(iss) time.sleep(15) plotiss(iss)