0
I’m doing a crud maintenance using python/kivy. It’s four main files, one for table P, one for A, and one for C. The fourth main file is the main screen that will have three buttons for you to choose which table to edit and, when clicked on this button, runs the main of the selected table. However, I don’t remember how to execute a file when the button is clicked. Follow the main python code:
import kivy
from main_Aluno.py import Manutencao_A
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
class TelaPrincipal(App):
pass
class Button(BoxLayout):
def clickA(self)
return main_Aluno.py
def clickP(self):
return main_Professor.py
def clickC(self):
return main_Curso.py
botao = TelaPrincipal()
botao.run()
Note: Maintenance is the class that contains the main A
I don’t know if it’s relevant but follow the kivy code too:
<Button@BoxLayout>:
orientation: vertical
Label:
text: "Escolha a tela a ser editada"
Button:
text: "Alunos"
on_press: root.clickA()
Button:
text: "Professores"
on_press: root.clickP()
Button:
text: "Cursos"
on_press: root.clickC()