
import json
import urllib.request
import turtle

import time

url = 'http://api.open-notify.org/astros.json'
response = urllib.request.urlopen(url)
result = json.loads(response.read())
import pprint

print(result)

print("People on the ISS: ",result['number'])
people = result['people']
#print(people)

#for person in people:
#    print(person)

print("People on the ISS right now.")
for person in people :
    print(f"\t {person['name']}")


url = 'http://api.open-notify.org/iss-now.json'
response = urllib.request.urlopen(url)
result = json.loads(response.read())

pprint.pprint(result)

location = result['iss_position']
latitude = location['latitude']
longitude = location['longitude']

print("The current position")
print('Latitude:  ',latitude)
print('Longitude: ',longitude)
