Skip to content

Instantly share code, notes, and snippets.

@zaquestion
Created May 29, 2017 22:17
Show Gist options
  • Save zaquestion/b5d7c982e96844b143531b572cda0e46 to your computer and use it in GitHub Desktop.
Save zaquestion/b5d7c982e96844b143531b572cda0e46 to your computer and use it in GitHub Desktop.
import requests
import os
def main():
print("Starting program")
response = requests.get("https://current.zaquestion.io/location")
err = response.json().get("error")
# dictionary = { "error": "Do: Key not found" }
#
# dictionary = {}
# dictionary["error"] = "Do: Key not found"
err = response.json().get("error")
if err is not None:
print("Error:",err)
exit(1)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment