Bonjour ,

je suis entrain de coder le jeux puissance 4 , je suis encore au niveau de l'interface graphique . j'ai un problème ,mon interface ne s'affiche pas .

Voila mon code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 
from tkinter import *
 
 
class Can(Canvas):
 
 
    def __init__(self):
 
 
        self.color      = ["red", "#EDEF3A"]
 
 
        self.clair      = "light blue"
        self.can        = Canvas.__init__(self, width =446, height = 430, bg= "light blue", bd=0)
 
        self.grid(row=1, columnspan =5)
 
 
        self.joueur = 1
        self.create_rectangle(20,400,115,425,fill= "light blue")
        self.create_text(35, 405, text ="Player :", anchor = NW, fill = "black")
        self.indiccoul = self.create_oval(85, 405, 100, 420, fill = self.color[1])
 
 
 
                self.create_rectangle(330,400,420,425,fill= "light blue")
        		self.create_text(340, 405, text ="New Game", anchor = NW, fill = "black" )
 
 
 
        self.ovals = []
        for y in range(10, 390, 55):
            for x in range(10, 437, 63):
                self.ovals.append(self.create_oval(x, y, x + 50, y + 50 , fill= "white"))
 
 
 
 
 
        self.destroy()
 
 
if __name__ ==	"__main__" :
    fen = Tk()
    fen.title("P4")
    can = Can()
    fen.mainloop()