Answer the question
In order to leave comments, you need to log in
Python Kivy error object.__init__() takes exactly one argument?
Source code in Python Kivy:
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.config import Config
Config.set('graphics','resizable',0)
class CalculatorApp(App):
def build(self):
bl = BoxLayout(orietation = 'vertical')
gl = GridLayout(cols = 4)
bl.add_widget( Label(text='0') )
gl.add_widget( Button(text='7') )
gl.add_widget( Button(text='8') )
gl.add_widget( Button(text='9') )
gl.add_widget( Button(text='x') )
gl.add_widget( Button(text='4') )
gl.add_widget( Button(text='5') )
gl.add_widget( Button(text='6') )
gl.add_widget( Button(text='-') )
gl.add_widget( Button(text='1') )
gl.add_widget( Button(text='2') )
gl.add_widget( Button(text='3') )
gl.add_widget( Button(text='+') )
gl.add_widget( Button(text='C') )
gl.add_widget( Button(text='0') )
gl.add_widget( Button(text='.') )
gl.add_widget( Button(text='=') )
bl.add_widget( gl )
return bl
if __name__ == "__main__":
CalculatorApp().run()
TypeError: object.__init__() takes exactly one argument (the instance to initialize)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question