May 2019
Beginner to intermediate
452 pages
16h 34m
English
We defined a constant called ISS_API_URL that has the URL that we can use to retrieve information on where the ISS is currently located. When we call this API by performing an HTTP GET request, the server returns its output in JSON format. We can then use the json method on the returned request object to parse this response into Python data structures. We can access the iss_position key and the latitude and longitude information within that dictionary. The rest of the track_space_station function just loops for 10 iterations, with a 1-second sleep between each loop, before calling the API and printing its parsed results.
Read now
Unlock full access