[Python] Python - Login Code not working in Kivy

Discussão em 'Python' iniciado por Stack, Maio 21, 2025.

  1. Stack

    Stack Membro Participativo

    The following error is appearing when I try to run this code. I tried in both versions of Python (2 and 3):


    Syntax Error: Invalid syntax
    ​

    from Kivy.app import App
    from Kivy.uix.label import Label
    from kivy.uix.gridlayout import GridLayout
    from kivy.uix.textinput import TextInput

    class LoginScreen(GridLayout):
    def __init__(self, **kwargs):
    super(LoginScreen, self).__init__(**kwargs)
    self.cols = 2
    self.add_widget(Label(text="Username:"))
    self.username = TextInput(multiline=False)
    self.add_widget(self.username)

    class SimpleKivy(App):
    def build(sef):
    return LoginScreen()

    Continue reading...

Compartilhe esta Página