Advertisement
Narzew

Global name is not defined

Sep 7th, 2014
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. ERROR:  Traceback (most recent call last):
  2.    File "main.py", line 139, in <module>
  3.      PlanLekcji().run()
  4.    File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 766, in run
  5.      root = self.build()
  6.    File "main.py", line 125, in build
  7.      sm.add_widget(BellsScreen(name='bells'))
  8.  TypeError: __init__() got an unexpected keyword argument 'name'
  9.  
  10.  
  11. class BellsScreen(Screen):
  12.  
  13.     def __init__(self):
  14.         self.skrocone = False
  15.        
  16.     def toogle_skrocone(self,nr):
  17.         nr = int(nr)
  18.         if skrocone == True:
  19.             skrocone = False
  20.         else:
  21.             skrocone = True
  22.         if nr == 0:
  23.             root.show_bells()
  24.         else:
  25.             root.show_breaks()
  26.    
  27.     def show_bells(self):
  28.         if skrocone==True:
  29.             file = open("Info/Bells2.txt","rb")
  30.         else:
  31.             file = open("Info/Bells1.txt","rb")
  32.         data = file.read()
  33.         file.close()
  34.         self.ids.dzwonki_label.text = data
  35.         return data
  36.        
  37.     pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement