Created
May 29, 2017 22:17
-
-
Save zaquestion/b5d7c982e96844b143531b572cda0e46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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