Guest User

Untitled

a guest
Aug 16th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import kivy
  2. import requests
  3. from kivy.uix.button import Button
  4. from urllib2 import urlopen
  5.  
  6.  
  7. from kivy.app import App
  8. from kivy.uix.button import Button
  9.  
  10. class MyApp(App):
  11.  
  12.  
  13.  
  14. def build(self):
  15. payload = {"name":"James"}
  16. url = "https://api.myjson.com/bins/3a51x"
  17. r = requests.get(url)
  18. result = r.json()
  19. print r.status_code
  20. return Button(text=result["name"])
  21.  
  22. if __name__ == '__main__':
  23. MyApp().run()
Advertisement
Add Comment
Please, Sign In to add comment