Answer the question
In order to leave comments, you need to log in
How to get rid of TypeError TypeError: object.__init__() takes no arguments if I have no objects in the class?
Good afternoon! There is an application in Kivy, and inside the program there is a class that does not allow me to run the program without errors. Where is the error that causes the program to finish compiling?
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
from kivy.config import Config
import matplotlib.colors as colors
def hexToRGB(parameter):
rgba = list(colors.hex2color(parameter))
rgba[0] = int(rgba[0])
rgba[1] = int(rgba[1])
rgba[2] = int(rgba[2])
rgba.append(1)
return list(rgba)
Config.set('graphics', 'resizable', '0')
Config.set('graphics', 'width', '500')
Config.set('graphics', 'height', '500')
class MyApp(App):
title = 'Моя первая приложка!'
def build(self):
calc_label = FloatLayout(size=(300, 300))
calc_label.add_widget(Label(text="Hello World",
font_size=30,
background_color = hexToRGB('#2E8B57'),
background_normal = '',
size_hint = (.99, .1),
pos = (0, 500/2)));
return calc_label
if __name__ == "__main__":
MyApp().run()
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