Salut !!!
Voila je commence sous python et j'utilise tkinter pour faire l'interface graphique.
Je suis un habitué de VB mais sous python je sais pas comment faire pour ouvrir une autre fenêtre GUI depuis un simple bouton.
J'ai pour cela un fichier test.py
1 2 3 4 5 6 7 8 9 10 11 12
| import sys
import os
import tkinter as tk
root = tk.Tk()
def helloCallBack():
os.system('connect_mysql.py')
#Keep_both_files_in_the_same_Folder
b1=tk.Button(root, text="OUVRIR",bg="white",command=helloCallBack)
b1.pack()
root.mainloop() |
et un fichier connect_mysql.py
1 2 3 4 5 6
| from tkinter import *
root = Tk()
w = Label(root, text="Hello World")
w.pack()
root.mainloop() |
Mais rien ne se passe, j'ai :
sh: connect_mysql.py: command not found
Car je ne sais pas comment appeler cette fenêtre.
Merci de votre aide.
Partager