v0.1
Sauvegarde du 08/04/2020
This commit is contained in:
parent
e56c2ef635
commit
df7309284c
8 changed files with 52 additions and 0 deletions
3
config.json
Normal file
3
config.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
17
main.pyw
Normal file
17
main.pyw
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
########### import #############
|
||||||
|
from tkinter import *
|
||||||
|
import os
|
||||||
|
|
||||||
|
########## constante ###########
|
||||||
|
PATH_MODULE = "module/"
|
||||||
|
|
||||||
|
######## initialisation ########
|
||||||
|
Fen = Tk()
|
||||||
|
classModule = {} # Dictionnaire qui va contenir tout les modules afin qu'ils puissent intéragir entre eux
|
||||||
|
|
||||||
|
for file in os.listdir(PATH_MODULE): # On cherche les modules dans leur dossier
|
||||||
|
with open(PATH_MODULE + file, "rb") as module: # On les ouvres en lecture
|
||||||
|
exec(module.read()) # On les executes
|
||||||
|
|
||||||
|
|
||||||
|
mainloop() # On "active" la fênetre
|
0
module/button.py
Normal file
0
module/button.py
Normal file
10
module/display.py
Normal file
10
module/display.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
class display():
|
||||||
|
def __init__(self):
|
||||||
|
self.frame = LabelFrame(Fen, text = "Display") # On créer une sous-fenêtre
|
||||||
|
self.frame.grid(row = 1, column = 1, sticky = "NEWS") # On l'affiche
|
||||||
|
|
||||||
|
self.label = Label(self.frame, text = "ici on affichera le texte")
|
||||||
|
self.label.grid(row = 1, column = 1, sticky = "NEWS")
|
||||||
|
|
||||||
|
|
||||||
|
classModule["display"] = display()
|
0
module/morse.py
Normal file
0
module/morse.py
Normal file
0
module/safe.py
Normal file
0
module/safe.py
Normal file
0
module/simon.py
Normal file
0
module/simon.py
Normal file
22
module/wire.py
Normal file
22
module/wire.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
class wire():
|
||||||
|
def __init__(self):
|
||||||
|
self.frame = LabelFrame(Fen, text = "Wire") # On créer une sous-fenêtre
|
||||||
|
self.frame.grid(row = 1, column = 2, sticky = "NEWS") # On l'affiche
|
||||||
|
|
||||||
|
self.dico_wire = {} # On créer un dictionnaire vide qui va contenir tout les éléments
|
||||||
|
|
||||||
|
for index, led in enumerate("ABCDEF"): # Il y a 6 câbles différents nommé par ces lettres
|
||||||
|
self.dico_wire[led] = {} # On les tries par leur lettre associé
|
||||||
|
|
||||||
|
self.dico_wire[led]["ID"] = Label(self.frame, text = led) # Affichage de la lettre du fil
|
||||||
|
self.dico_wire[led]["ID"].grid(row = index, column = 0)
|
||||||
|
|
||||||
|
self.dico_wire[led]["LED"] = Label(self.frame, text = "", background = "lightgray", relief = SUNKEN, width = 2, height = 1) # Affichage de la led
|
||||||
|
self.dico_wire[led]["LED"].grid(row = index, column = 1)
|
||||||
|
|
||||||
|
self.dico_wire[led]["WIRE"] = Button(self.frame, text = "---------------------", relief = FLAT) # Affichage du fil coupable
|
||||||
|
self.dico_wire[led]["WIRE"].grid(row = index, column = 2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
classModule["wire"] = wire() # On ajoute le module à la liste des modules
|
Loading…
Reference in a new issue