Advertisement
Guest User

Untitled

a guest
Jul 16th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. class discord_rito():
  2.     #d = grab_weather()
  3.     ritoLink = 'https://na1.api.riotgames.com/lol/summoner/v3/summoners/by-name/incompatible?api_key=RGAPI'
  4.     def __init__(self):
  5.         self.dummyID = '59641562'
  6.         self.dummyName = 'Incompatible'
  7.         self.string = None
  8.         self.j = None
  9.         self.summName = None
  10.  
  11.     def requestUrl(self, url):
  12.         response = urlopen(url)
  13.         self.string = reponse.read().decode('utf-8')
  14.         self.j = json.loads(self.string)
  15.         print(self.j)
  16.  
  17.     self.requestUrl(ritoLink)
  18.  
  19. PS C:\Workspace\Discord_Ry> py .\rito.py
  20. Traceback (most recent call last):
  21.   File ".\rito.py", line 4, in <module>
  22.     class discord_rito():
  23.   File ".\rito.py", line 20, in discord_rito
  24.     self.requestUrl(ritoLink)
  25. NameError: name 'self' is not defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement