Skip to content

Instantly share code, notes, and snippets.

@with-shrey
Forked from anonymous/Day3.txt
Last active October 31, 2017 16:58
Show Gist options
  • Save with-shrey/ae9cdc71359a9a8b90fbb109067b1f5a to your computer and use it in GitHub Desktop.
Save with-shrey/ae9cdc71359a9a8b90fbb109067b1f5a to your computer and use it in GitHub Desktop.
Mozilla Python Networking App Session day 3
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"
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)
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']
import requests
r=requests.get("https://www.google.com")
print r.text
@with-shrey
Copy link
Author

root = Tk()
scrollbar = Scrollbar(root)
scrollbar.pack( side = RIGHT, fill = Y )
mylist = Listbox(root, yscrollcommand = scrollbar.set )
for line in range(100):
mylist.insert(END, "This is line number " + str(line))

mylist.pack( side = LEFT, fill = BOTH )
scrollbar.config( command = mylist.yview )

mainloop()

@with-shrey
Copy link
Author

@with-shrey
Copy link
Author

import webbrowser

@with-shrey
Copy link
Author

Search terms On app barnyard, bird, cat, dog, horse, reptile, smallfurry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment