Bonjour,
je suis nouveau sur ce forum donc je peux me tromper. Merci de m'aider à corriger.
Retraité je suis engagé dans une association humanitaire et j'ai développé un petit programme pour cette association en VBA.
Pour l'heure je voudrais essayer de comprendre la programmation en Python.
J'ai tester un petit programme de saisie de données et récupération de celles-ci pour affichage mais cela ne fonctionne pas.
J'uilise input.get() pour remplir une variable avec le conenu de la saisie mais seul le texte par défaut apparait.

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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import tkinter as tk
from tkinter import font
from tkinter import *
 
app = tk.Tk()
app.title('Assistance Humanitaire Internationale')
app.geometry("1000x500")
 
custom_font = font.Font(family="Helvetica", size=14, weight="bold")
 
labelTitre1 = tk.Label(app, text="SAISIE ADHERENTS", fg="blue", bg="#FF0", font=custom_font)
labelTitre1.place(x=500, y=0) #              x = du bord gauche - y= du haut
labelTitre2 = tk.Label(app, text="--------------------------------------")
labelTitre2.place(x=500, y=25)
#-----
labelNom = tk.Label(app, text="NOM", fg="blue", bg="#FF0")
labelNom.place(x=0, y=50)
custom_font = font.Font(family="Helvetica", size=8, weight="bold")
labelNom2 = tk.Label(app, text="ATTENTION: utiliser le - pour les noms composés", fg="Red", bg="#0ff", font=custom_font)
labelNom2.place(x=300, y=50)
labelPrenom = tk.Label(app, text="PRENOM", fg="blue", bg="#FF0")
labelPrenom.place(x=0, y=75)
labelPrenom2 = tk.Label(app, text="ATTENTION: utiliser le - pour les prénoms composés", fg="Red", bg="#0ff", font=custom_font)
labelPrenom2.place(x=300, y=75)
labelAdresse1 = tk.Label(app, text="Adresse1")
labelAdresse1.place(x=0, y=100)
labelAdresse2 = tk.Label(app, text="Adresse2")
labelAdresse2.place(x=0, y=125)
labelCpostal = tk.Label(app, text="Code Postal")
labelCpostal.place(x=0, y=150)
labelVille = tk.Label(app, text="Ville")
labelVille.place(x=325, y=150)
labelTphfixe = tk.Label(app, text="Tph fixe")
labelTphfixe.place(x=0, y=175)
labelTphport = tk.Label(app, text="Tph portable")
labelTphport.place(x=325, y=175)
labelMail = tk.Label(app, text="Mail")
labelMail.place(x=0, y=200)
 
labelAdhesion = tk.Label(app, text="Année Adhésion")
labelAdhesion.place(x=700, y=50)
labelNaissance = tk.Label(app, text="Dete de naissance")
labelNaissance.place(x=700, y=75)
labelProfession = tk.Label(app, text="Profession")
labelProfession.place(x=700, y=100)
labelLettre = tk.Label(app, text="Lettre info")
labelLettre.place(x=700, y=125)
labelLettre1 = tk.Label(app, text="Tapez O ou N", fg="Red", bg="#0ff")
labelLettre1.place(x=850, y=125)
labelCotisation = tk.Label(app, text="Année Cotisation", fg="Red", bg="Yellow")
labelCotisation.place(x=700, y=150)
 
entryNom = tk.Entry(app, width=30)
entryNom.insert(0, "Entrez votre nom ici")
Lenom = entryNom.get()
 
entryPrenom = tk.Entry(app, width=30) #width = longeur zone de saisie = largeur de la colonne
entryPrenom.insert(0, "Entrez votre prénom ici")
Leprenom = entryPrenom.get()
 
entryAdresse1 = tk.Entry(app, width=40)
entryAdresse2 = tk.Entry(app, width=40)
entryCpostal= tk.Entry(app, width=5)
entryVille = tk.Entry(app, width=40)
entryTphfixe = tk.Entry(app, width=12)
entryTphport = tk.Entry(app, width=12)
entryMail = tk.Entry(app, width=40)
entryAdhesion = tk.Entry(app, width=4)
entryNaissance = tk.Entry(app, width=10)
entryProfession = tk.Entry(app, width=25)
entryLettre = tk.Entry(app, width=1)
entryCotisation = tk.Entry(app, width=4)
 
# x = du bord gauche - y= du haut
entryNom.place(x=85, y=50)
entryPrenom.place(x=85, y=75)
entryAdresse1.place(x=85, y=100)
entryAdresse2.place(x=85, y=125)
entryCpostal.place(x=85, y=150)
entryVille.place(x=410, y=150)
entryTphfixe.place(x=85, y=175)
entryTphport.place(x=410, y=175)
entryMail.place(x=85, y=200)
entryAdhesion.place(x=825, y=50)
entryNaissance.place(x=825, y=75)
entryProfession.place(x=825, y=100)
entryLettre.place(x=825, y=125)
entryCotisation.place(x=825, y=150)
#----------------------
 
Button0 = tk.Button(app, text="VALIDER")
Button0.place(x=0, y=450)
 
Button1 = tk.Button(app, text="MODIFIER")
Button1.place(x=100, y=450)
Button2 = tk.Button(app, text="SUPPRIMER")
Button2.place(x=200, y=450)
Button3 = tk.Button(app, text="QUITTER",command = quit)
Button3.place(x=300, y=450)
 
print("Bonjour " + Lenom +" " + Leprenom)
 
app.mainloop()

Pouvez-vous m'aider pourquoi "Lenom = entryNom.get()" ne fonctionne pas
erci de votre aide et de vos explications.
A vous lire