-
-
Save with-shrey/ae9cdc71359a9a8b90fbb109067b1f5a to your computer and use it in GitHub Desktop.
Mozilla Python Networking App Session day 3
This file contains hidden or 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
Google search term pet api | |
API Key : ad4e5f02703f7faf7945ab02d55fa136 | |
Api Search Engines: | |
www.programmableweb.com | |
apis.io etc.. | |
Api used | |
http://api.petfinder.com | |
http://www.petfinder.com/developers/api-docs | |
Commands To Install Requests In cmd | |
C:\Users\XCODER>cd C:\Python27\Scripts | |
C:\Python27\Scripts>pip install requests | |
JSON | |
Json Beautifier google search | |
The Missing Json Inspector Chrome Extension | |
ListBox Widget | |
Code Found On Tutorial point Google Search Term "python scrollbar" |
This file contains hidden or 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 json | |
import pprint | |
s='{"menu": { \ | |
"id": "file", \ | |
"value": "File", \ | |
"popup": { \ | |
"menuitem": [ \ | |
{"value": "New", "onclick": "CreateNewDoc()"}, \ | |
{"value": "Open", "onclick": "OpenDoc()"},\ | |
{"value": "Close", "onclick": "CloseDoc()"}\ | |
]\ | |
}\ | |
}}' | |
res=json.loads(s) | |
pp = pprint.PrettyPrinter(indent=1) | |
pp.pprint(res) |
This file contains hidden or 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 json | |
s='{"menu": { \ | |
"id": "file", \ | |
"value": "File", \ | |
"popup": { \ | |
"menuitem": [ \ | |
{"value": "New", "onclick": "CreateNewDoc()"}, \ | |
{"value": "Open", "onclick": "OpenDoc()"},\ | |
{"value": "Close", "onclick": "CloseDoc()"}\ | |
]\ | |
}\ | |
}}' | |
res=json.loads(s) | |
print res['menu']['menuitem'][0]['onclick'] |
This file contains hidden or 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 | |
r=requests.get("https://www.google.com") | |
print r.text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search terms On app barnyard, bird, cat, dog, horse, reptile, smallfurry