| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 
 | def master():
    master_file = askopenfilename()
    return master_file
 
def srt():
 
    srt_file = askopenfilename(filetypes = [("srt","*.srt")])
    return srt_file
 
def encodage(master_file, srt_file):
    print (master_file)
    print (srt_file)
 
#------ Programme principal -------
 
# Création du widget principal ("maître") :
fenetre = Tk()
fenetre.title('Incrustation') 
fenetre.geometry("300x200")
 
# création des boutons :
bou1 = Button(fenetre,text='fichier master',command=master)
bou2 = Button(fenetre,text='fichier srt',command=srt)
bou3 = Button(fenetre,text='encoder',command=lambda:encodage(master_file,srt_file))
bou4 = Button(fenetre,text='Quitter',command=fenetre.quit)
 
bou1.grid(row =1, column =1, padx=100,pady=5)
bou2.grid(row =2, column =1, padx=100,pady=5)
bou3.grid(row =3, column =1, padx=100,pady=5)
bou4.grid(row =4, column =1, padx=100,pady=5)
 
fenetre.mainloop()              # démarrage du réceptionnaire d'événements
 
fenetre.quit()               # destruction (fermeture) de la fenêtre | 
Partager