Précédent   Forum du club des développeurs et IT Pro > Autres langages > Python & Zope > Général Python
Général Python Forum d'entraide sur les fondamentaux du langage Python, syntaxe, POO, bibliothèque standard, ...
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 26/02/2013, 23h26   #1
ayoubitou
Invité de passage
 
Inscription : février 2013
Messages : 1
Détails du profil
Informations forums :
Inscription : février 2013
Messages : 1
Points : 0
Points : 0
Par défaut interface ne s'affiche pas

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 :
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()
ayoubitou est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/02/2013, 05h11   #2
__dardanos__
Membre confirmé
 
Homme arnaud
Ingénieur développement logiciels
Inscription : janvier 2013
Messages : 159
Détails du profil
Informations personnelles :
Nom : Homme arnaud
Localisation : France

Informations professionnelles :
Activité : Ingénieur développement logiciels
Secteur : Conseil

Informations forums :
Inscription : janvier 2013
Messages : 159
Points : 283
Points : 283
Salut.

Ben, il faut éliminer le self.destroy() du constructeur.

Je te conseille de d'abord concevoir le programme et de terminer par l'interface.

Bon courage.
__dardanos__ est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 03h32.


 
 
 
 
Partenaires

Hébergement Web