TypeError: descriptor '__init__' of 'object' object needs an argument
import kivy
from kivy.ap+p import App
from kivy.uix.label import Label
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.config import Config
from kivy.uix.floatlayout import FloatLayout
class myapp(App):
def build(self):
fl = FloatLayout(silf = (300, 300))
fl.add_widget(Button(text = 'ты это я', on_press = self.btn_press,
background_color = [1, 0, 80, 1], size_hint = (.5, .25), pos = (0, 0)));
return fl
def btn_press(self, instance):
print("зачем нажал?")
instance.text = "проблемы?"
if __name__ == '__main__':
myapp().run()
from kivy import Config
from [kivy.app](http://kivy.app) import App
from kivy.uix.button import Button
Config.set('graphics', 'resizable', 1)
Config.set('graphics', 'width', '700')
Config.set('graphics', 'height', '600')
class myapp(App):
def build(self):
return Button(text="ты это я", font_size="30sp",
background_color=(1, 1, 1, 1),
color=(50, 50, 50, 50),
size=(15, 15),
size_hint=(.2, .2),
pos=(0, 0), on_press=self.btn_press)
def btn_press(self, *args):
print("зачем нажал?")
if __name__ == '__main__':
myapp().run()