M
M
Minamin2018-06-24 19:25:28
Python
Minamin, 2018-06-24 19:25:28

TypeErrot: object.__init__() takes no parameters. How to fix?

Code from Kivy tutorial:

from kivy.app import App
from kivy.uix.button import Button 

class MyApp(App):
  def build(self):
    return Button(text = "Кнопка", 
      front_size = 30, 
      on_press = self.callback)

  def callback(self, instance):
    print("Кнопка нажата.")

if __name__ == "__main__":
  MyApp().run()

When trying to start:
5b2fc5bc07b05231344185.png
There is an assumption that I am autistic, and I do not notice the obvious. Help me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2018-06-24
@Minamin

font_size
And you have some kind of front:

return Button(text = "Кнопка", 
      front_size = 30, 
      on_press = self.callback)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question