IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Tkinter Python Discussion :

Utilisation tkinter niveau debutant


Sujet :

Tkinter Python

  1. #1
    Candidat au Club
    Homme Profil pro
    Enseignant
    Inscrit en
    Mai 2015
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Mai 2015
    Messages : 2
    Points : 2
    Points
    2
    Par défaut Utilisation tkinter niveau debutant
    Bonjour,
    Je suis novice en Python et j aimerais developper une interface graphique qui ressemble a ceci mais en bien plus joli.
    vaut il mieux utiliser des frames contenues dans une frame racine, des canvas dans une frame racine ou une seule frame racine??
    Merci pour votre aide
    Je suis en Python 3.4
    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
    49
    from tkinter import *
     
    # Création de la frame principale
    root = Tk()
    root.title("Mini-projet")
    root.geometry('800x800+200+200')
     
     
     
    Label(root, text='ALICE', fg="blue", font=("Comics",18)).grid(row=1, column=0,sticky=W+E+N+S,padx=5, pady=5)
    Label(root, text="Texte: ").grid(row=2, column=0, sticky=E,padx=5, pady=5)
    Label(root, text="Condensat 1: ").grid(row=3, column=0, sticky=E,padx=5, pady=5)
    Label(root, text="Condensat 1 crypté: ").grid(row=4, column=0, sticky=E,padx=5, pady=5)
    e1=Entry(root)
    e2=Entry(root)
    e3=Entry(root)
    e1.grid(row=2, column=1,sticky =W)
    e2.grid(row=3, column=1,sticky =W)
    e3.grid(row=4, column=1,sticky =W)
    canvas1=Canvas(root, width=160, height=160, bg='white')
    photoA = PhotoImage(file='Alice.gif')
    canvas1.create_image(70,90,image=photoA)
    canvas1.grid(row=2, column=3, columnspan=2, rowspan=2 ,sticky=W)
    def callback():
        print ("click!")    
    boutonHasherA = Button(root, text='Hacher',command=callback).grid(row=5, column=0, sticky =W, padx=5, pady=5)
    boutonCodage = Button(root, text='Coder', command=callback).grid(row=5, column=1,sticky =W, padx=5, pady=5)
    boutonEnvoyerer = Button(root, text='Envoyer', command=root.destroy).grid(row=5, column=2,sticky =W, padx=5, pady=5)
    Label(root, text='BOB', fg="red", font=("Comics",18)).grid(row=7, column=0,sticky=W+E+N+S,padx=5, pady=5)
    Label(root, text="Texte: ").grid(row=8, column=0, sticky=E,padx=5, pady=5)
    Label(root, text="Condensat 2: ").grid(row=9, column=0, sticky=E,padx=5, pady=5)
    Label(root, text="Condensat reçu décrypté: ").grid(row=10, column=0, sticky=E,padx=5, pady=5)
    Label(root, text="RESULTAT TEST: ").grid(row=11, column=0, sticky=E,padx=5, pady=5)
    e4=Entry(root)
    e5=Entry(root)
    e6=Entry(root)
    e7=Entry(root)
    e4.grid(row=8, column=1,sticky =W)
    e5.grid(row=9, column=1,sticky =W)
    e6.grid(row=10, column=1,sticky =W)
    e7.grid(row=11, column=1,sticky =W)
    canvas2=Canvas(root, width=160, height=160, bg='white')
    photoB = PhotoImage(file='Bob.gif')
    canvas2.create_image(70,70,image=photoB)
    canvas2.grid(row=8, column=3, columnspan=2, rowspan=2 ,sticky=W)
    boutonHasherB = Button(root, text='Hacher',command=callback).grid(row=12, column=0, sticky =W, padx=5, pady=5)
    boutonDecodage = Button(root, text='Décoder', command=callback).grid(row=12, column=1,sticky =W, padx=5, pady=5)
    boutonQuitter = Button(root, text='Quitter', command=root.destroy).grid(row=12, column=2,sticky =W, padx=5, pady=5)
    root.mainloop()
    Images attachées Images attachées  

Discussions similaires

  1. utilisation de RegExp,debutant
    Par Mobistar dans le forum Général JavaScript
    Réponses: 6
    Dernier message: 12/08/2008, 17h11
  2. Utiliser request.setAttribute[Debutant J2EE]
    Par Sabact dans le forum Servlets/JSP
    Réponses: 5
    Dernier message: 30/05/2008, 10h56
  3. [RegEx] Petit casse tete amusant [niveau debutant]
    Par rodeo_fly dans le forum Langage
    Réponses: 6
    Dernier message: 12/09/2007, 16h20
  4. [Sondage] Utilisation CR : niveau d'etude ? statut ? salaire ?
    Par Gotch59 dans le forum SAP Crystal Reports
    Réponses: 9
    Dernier message: 27/05/2007, 21h33
  5. Cas d'utilisation, quel niveau de détails
    Par Celelibi dans le forum Cas d'utilisation
    Réponses: 5
    Dernier message: 20/02/2005, 20h16

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo