Accueil > Forum > > > > Python 3.1.2 : .py vers .exe / Tkinter : placé les widegets n'importe où
Python 3.1.2 : .py vers .exe / Tkinter : placé les widegets n'importe où
lundi 24 janvier 2011 à 18:22:46 |
Python 3.1.2 : .py vers .exe / Tkinter : placé les widegets n'importe où

Bios56
|
Bonjour tout le monde !
J'ai deux questions très spécial aujourd'hui ^^ Sachant que je parle de python 3.1.2 pour l'ensemble des 2 questions qui seront posées:
Premiérement, serait-il possible que vous me donniez un lien de téléchargement de py2exe pour python 3.1.2 parce que je ne sais vraiment pas ou trouvé une bonne version, et si possible de me re-dirigé vers un tutorial pour compilé un fichier .py en .exe (toujour sous python 3.1.2 ^^)
Deuxiémement, j'ai mit au point un algorithme qui à partir des coordonnées de 3 points permettrais de définir si le triangle formé est rectangle... bref la n'est pas le probleme l'algo marche très bien. J'ai aussi installé le module tkinter et turtle pour pouvoir faire un dessin de ce triangle et j'ai ajouté des boutons de "zoom" dans la fenétre tkinter... et c'est la que se pose mon probleme ! J'aimerais savoir si il est possible d'installé les widgets de tkinter (boutons, labels etc ...) directement dans la fenétre pop par turtle ? Ce serais bien plus estéthique qu'une fenétre qui se balade ^^ Je vous met ci dessous l'algo corespondant =)
Code Python : from turtle import *
from tkinter import *
def Figure():
reset()
speed(0)
width(2)
up()
goto(Ax,Ay)
down()
color("blue")
goto(Bx,By)
color("black")
write(Deuxième_point)
color("red")
goto(Cx,Cy)
color("black")
write(Troisième_point)
color("green")
goto(Ax,Ay)
color("black")
write(Premier_point)
def Zoom_avant_x2():
reset()
speed(0)
width(2)
up()
goto(Ax*2,Ay*2)
down()
color("blue")
goto(Bx*2,By*2)
color("black")
write(Deuxième_point)
color("red")
goto(Cx*2,Cy*2)
color("black")
write(Troisième_point)
color("green")
goto(Ax*2,Ay*2)
color("black")
write(Premier_point)
def Zoom_avant_x4():
reset()
speed(0)
width(2)
up()
goto(Ax*4,Ay*4)
down()
color("blue")
goto(Bx*4,By*4)
color("black")
write(Deuxième_point)
color("red")
goto(Cx*4,Cy*4)
color("black")
write(Troisième_point)
color("green")
goto(Ax*4,Ay*4)
color("black")
write(Premier_point)
def Zoom_avant_x6():
reset()
speed(0)
width(2)
up()
goto(Ax*6,Ay*6)
down()
color("blue")
goto(Bx*6,By*6)
color("black")
write(Deuxième_point)
color("red")
goto(Cx*6,Cy*6)
color("black")
write(Troisième_point)
color("green")
goto(Ax*6,Ay*6)
color("black")
write(Premier_point)
def Zoom_avant_x8():
reset()
speed(0)
width(2)
up()
goto(Ax*8,Ay*8)
down()
color("blue")
goto(Bx*8,By*8)
color("black")
write(Deuxième_point)
color("red")
goto(Cx*8,Cy*8)
color("black")
write(Troisième_point)
color("green")
goto(Ax*8,Ay*8)
color("black")
write(Premier_point)
def Zoom_avant_x10():
reset()
speed(0)
width(2)
up()
goto(Ax*10,Ay*10)
down()
color("blue")
goto(Bx*10,By*10)
color("black")
write(Deuxième_point)
color("red")
goto(Cx*10,Cy*10)
color("black")
write(Troisième_point)
color("green")
goto(Ax*10,Ay*10)
color("black")
write(Premier_point)
def Zoom_avant_x12():
reset()
speed(0)
width(2)
up()
goto(Ax*12,Ay*12)
down()
color("blue")
goto(Bx*12,By*12)
color("black")
write(Deuxième_point)
color("red")
goto(Cx*12,Cy*12)
color("black")
write(Troisième_point)
color("green")
goto(Ax*12,Ay*12)
color("black")
write(Premier_point)
def Zoom_avant_x14():
reset()
speed(0)
width(2)
up()
goto(Ax*14,Ay*14)
down()
color("blue")
goto(Bx*14,By*14)
color("black")
write(Deuxième_point)
color("red")
goto(Cx*14,Cy*14)
color("black")
write(Troisième_point)
color("green")
goto(Ax*14,Ay*14)
color("black")
write(Premier_point)
def Zoom_avant_x16():
reset()
speed(0)
width(2)
up()
goto(Ax*16,Ay*16)
down()
color("blue")
goto(Bx*16,By*16)
color("black")
write(Deuxième_point)
color("red")
goto(Cx*16,Cy*16)
color("black")
write(Troisième_point)
color("green")
goto(Ax*16,Ay*16)
color("black")
write(Premier_point)
def Zoom_avant_x18():
reset()
speed(0)
width(2)
up()
goto(Ax*18,Ay*18)
down()
color("blue")
goto(Bx*18,By*18)
color("black")
write(Deuxième_point)
color("red")
goto(Cx*18,Cy*18)
color("black")
write(Troisième_point)
color("green")
goto(Ax*18,Ay*18)
color("black")
write(Premier_point)
def Zoom_avant_x20():
reset()
speed(0)
width(2)
up()
goto(Ax*20,Ay*20)
down()
color("blue")
goto(Bx*20,By*20)
color("black")
write(Deuxième_point)
color("red")
goto(Cx*20,Cy*20)
color("black")
write(Troisième_point)
color("green")
goto(Ax*20,Ay*20)
color("black")
write(Premier_point)
def Zoom_arrière_x2():
reset()
speed(0)
width(2)
up()
goto(Ax/2,Ay/2)
down()
color("blue")
goto(Bx/2,By/2)
color("black")
write(Deuxième_point)
color("red")
goto(Cx/2,Cy/2)
color("black")
write(Troisième_point)
color("green")
goto(Ax/2,Ay/2)
color("black")
write(Premier_point)
def Zoom_arrière_x4():
reset()
speed(0)
width(2)
up()
goto(Ax/4,Ay/4)
down()
color("blue")
goto(Bx/4,By/4)
color("black")
write(Deuxième_point)
color("red")
goto(Cx/4,Cy/4)
color("black")
write(Troisième_point)
color("green")
goto(Ax/4,Ay/4)
color("black")
write(Premier_point)
def Zoom_arrière_x6():
reset()
speed(0)
width(2)
up()
goto(Ax/6,Ay/6)
down()
color("blue")
goto(Bx/6,By/6)
color("black")
write(Deuxième_point)
color("red")
goto(Cx/6,Cy/6)
color("black")
write(Troisième_point)
color("green")
goto(Ax/6,Ay/6)
color("black")
write(Premier_point)
def Zoom_arrière_x8():
reset()
speed(0)
width(2)
up()
goto(Ax/8,Ay/8)
down()
color("blue")
goto(Bx/8,By/8)
color("black")
write(Deuxième_point)
color("red")
goto(Cx/8,Cy/8)
color("black")
write(Troisième_point)
color("green")
goto(Ax/8,Ay/8)
color("black")
write(Premier_point)
def Zoom_arrière_x10():
reset()
speed(0)
width(2)
up()
goto(Ax/10,Ay/10)
down()
color("blue")
goto(Bx/10,By/10)
color("black")
write(Deuxième_point)
color("red")
goto(Cx/10,Cy/10)
color("black")
write(Troisième_point)
color("green")
goto(Ax/10,Ay/10)
color("black")
write(Premier_point)
def Zoom_arrière_x12():
reset()
speed(0)
width(2)
up()
goto(Ax/12,Ay/12)
down()
color("blue")
goto(Bx/12,By/12)
color("black")
write(Deuxième_point)
color("red")
goto(Cx/12,Cy/12)
color("black")
write(Troisième_point)
color("green")
goto(Ax/12,Ay/12)
color("black")
write(Premier_point)
def Zoom_arrière_x14():
reset()
speed(0)
width(2)
up()
goto(Ax/14,Ay/14)
down()
color("blue")
goto(Bx/14,By/14)
color("black")
write(Deuxième_point)
color("red")
goto(Cx/14,Cy/14)
color("black")
write(Troisième_point)
color("green")
goto(Ax/14,Ay/14)
color("black")
write(Premier_point)
def Zoom_arrière_x16():
reset()
speed(0)
width(2)
up()
goto(Ax/16,Ay/16)
down()
color("blue")
goto(Bx/16,By/16)
color("black")
write(Deuxième_point)
color("red")
goto(Cx/16,Cy/16)
color("black")
write(Troisième_point)
color("green")
goto(Ax/16,Ay/16)
color("black")
write(Premier_point)
def Zoom_arrière_x18():
reset()
speed(0)
width(2)
up()
goto(Ax/18,Ay/18)
down()
color("blue")
goto(Bx/18,By/18)
color("black")
write(Deuxième_point)
color("red")
goto(Cx/18,Cy/18)
color("black")
write(Troisième_point)
color("green")
goto(Ax/18,Ay/18)
color("black")
write(Premier_point)
def Zoom_arrière_x20():
reset()
speed(0)
width(2)
up()
goto(Ax/20,Ay/20)
down()
color("blue")
goto(Bx/20,By/20)
color("black")
write(Deuxième_point)
color("red")
goto(Cx/20,Cy/20)
color("black")
write(Troisième_point)
color("green")
goto(Ax/20,Ay/20)
color("black")
write(Premier_point)
print("Entrez le nom du premier point puis ses coordonnées:")
Premier_point=input()
Ax=float(input())
Ay=float(input())
print("Entrez le nom du deuxième point puis ses coordonnées:")
Deuxième_point=input()
Bx=float(input())
By=float(input())
print("Entrez le nom du troisème point puis ses coordonnées:")
Troisième_point=input()
Cx=float(input())
Cy=float(input())
ABx=Bx-Ax
ABy=By-Ay
ACx=Cx-Ax
ACy=Cy-Ay
Produit_scalaire_BAC=ABx*ACx+ABy*ACy
BCx=Cx-Bx
BCy=Cy-By
BAx=Ax-Bx
BAy=Ay-By
Produit_scalaire_CBA=BCx*BAx+BCy*BAy
CAx=Ax-Cx
CAy=Ay-Cy
CBx=Bx-Cx
CBy=By-Cy
Produit_scalaire_ACB=CAx*CBx+CAy+CBy
if Produit_scalaire_BAC==0:
print("Ce triangle est rectangle en",Premier_point,".")
else:
print("Ce triangle n'est pas rectangle en",Premier_point,".")
if Produit_scalaire_CBA==0:
print("Ce triangle est rectangle en",Deuxième_point,".")
else:
print("Ce triangle n'est pas rectangle en",Deuxième_point,".")
if Produit_scalaire_ACB==0:
print("Ce triangle est rectangle en",Troisième_point,".")
else:
print("Ce triangle n'est pas rectangle en",Troisième_point,".")
print("\nMade by Guillaume Caro.")
Fenetre=Tk()
Fenetre.title("Boite de commandes")
Frame=Frame(Fenetre)
Label1=Label(Frame,text="- Zoom +",fg="blue",bg="white")
Button20=Button(Frame,text=">",command=Zoom_arrière_x20)
Button18=Button(Frame,text=">",command=Zoom_arrière_x18)
Button16=Button(Frame,text=">",command=Zoom_arrière_x16)
Button14=Button(Frame,text=">",command=Zoom_arrière_x14)
Button12=Button(Frame,text=">",command=Zoom_arrière_x12)
Button10=Button(Frame,text=">",command=Zoom_arrière_x10)
Button8=Button(Frame,text=">",command=Zoom_arrière_x8)
Button6=Button(Frame,text=">",command=Zoom_arrière_x6)
Button4=Button(Frame,text=">",command=Zoom_arrière_x4)
Button2=Button(Frame,text=">",command=Zoom_arrière_x2)
Main_Button=Button(Frame,text="=",command=Figure)
Buttonx2=Button(Frame,text="<",command=Zoom_avant_x2)
Buttonx4=Button(Frame,text="<",command=Zoom_avant_x4)
Buttonx6=Button(Frame,text="<",command=Zoom_avant_x6)
Buttonx8=Button(Frame,text="<",command=Zoom_avant_x8)
Buttonx10=Button(Frame,text="<",command=Zoom_avant_x10)
Buttonx12=Button(Frame,text="<",command=Zoom_avant_x12)
Buttonx14=Button(Frame,text="<",command=Zoom_avant_x14)
Buttonx16=Button(Frame,text="<",command=Zoom_avant_x16)
Buttonx18=Button(Frame,text="<",command=Zoom_avant_x18)
Buttonx20=Button(Frame,text="<",command=Zoom_avant_x20)
Frame.pack()
Label1.pack(side="top")
Button20.pack(side="left")
Button18.pack(side="left")
Button16.pack(side="left")
Button14.pack(side="left")
Button12.pack(side="left")
Button10.pack(side="left")
Button8.pack(side="left")
Button6.pack(side="left")
Button4.pack(side="left")
Button2.pack(side="left")
Main_Button.pack(side="left")
Buttonx20.pack(side="right")
Buttonx18.pack(side="right")
Buttonx16.pack(side="right")
Buttonx14.pack(side="right")
Buttonx12.pack(side="right")
Buttonx10.pack(side="right")
Buttonx8.pack(side="right")
Buttonx6.pack(side="right")
Buttonx4.pack(side="right")
Buttonx2.pack(side="right")
Fenetre.mainloop()
Merci de votre attention =D
|
|
Cette discussion est classée dans : goto, write, ax, color, black
Répondre à ce message
Livres en rapport
|
Derniers Blogs
IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc REACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITERREACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITER par Groc
Une mauvaise utilisation de rx lors de l'écriture d'une couche d'accès à des services peut conduire à des cas embarassants avec des erreurs mal gérées, des appels qui ne partent lorsqu'ils le devraient, et même des résultats incorrects . le tout nuis...
Cliquez pour lire la suite de l'article par Groc SHAREPOINT BLOG SITE, PROBLèME D'ARCHIVESSHAREPOINT BLOG SITE, PROBLèME D'ARCHIVES par junarnoalg
Dernièrement, nous avons migré le site
myTIC
vers un nouveau serveur SharePoint 2010. Dans les contenus que nous vouloins récupérer, nous avions un certain nombre de blogs.
Nous avons utilisé les commandes Power...
Cliquez pour lire la suite de l'article par junarnoalg
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|