Сначала все ваши методы инициализации неверны. И есть еще пара ошибок. Сначала вы можете попробовать исправить функции init, если это не поможет, вы можете попробовать убрать все из методов init, как здесь:
class Main(Screen):
# if you want to redefine init function, you should do it like this
def __init__(self, **kwargs):
super(Main, self).__init__(**kwargs)
# screen is using relative layout, it doesn't have cols and rows!
# self.cols = 1
self.Main_firstISS = Button(size_hint = (0.45,0.2) , pos_hint = {'center_x': 0.5 , 'y': 0.2})
self.Main_secISS = Button(size_hint = (0.2,0.1) , pos_hint = {'x':0.8, 'y': 0} , text = "Exit")
self.Main_thirdISS = Label(text = "Wellcome to Guess Game\n play and enjoy")
self.add_widget(self.Main_firstISS)
self.add_widget(self.Main_secISS)
self.add_widget(self.Main_thirdISS)
class Second(Screen):
# same here
def __init__(self, **kwargs):
super(Second, self).__init__(**kwargs)
self.Second_firstISS = TextInput(hint_text = "What's your guess" , size_hint = (0.2,0.05) , pos_hint = {'center_x':0.5 , 'y': 0.7})
self.Second_secISS = Button(size_hint = (0.1,0.1) , pos_hint = {'x':0.9 , 'y': 0})
self.Second_firstISS.bind(on_press=self.callback)
self.add_widget(self.Second_firstISS)
self.add_widget(self.Second_secISS)
# put that function inside the class!
def callback(self, *args):
print(f"{self.Second_firstISS.text}")
# you don't need to inherit Main and Second classes
class Manager(ScreenManager):
def __init__(self , **kwargs):
# and here
super(Manager, self).__init__(**kwargs)
my_main_page = Main(name='main')
my_second_page = Second(name='second')
self.add_widget(my_main_page)
self.add_widget(my_second_page)