first commit
This commit is contained in:
commit
f44d3a16ce
39
test.py
Normal file
39
test.py
Normal file
@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
from tkinter import *
|
||||
|
||||
def click ():
|
||||
print (value.get())
|
||||
label2["text"]+=value.get()+"\r"
|
||||
|
||||
def click_reset ():
|
||||
print ("exit")
|
||||
fenetre.quit
|
||||
label2["text"]=""
|
||||
fenetre.mainloop
|
||||
|
||||
def check_channel(numero):
|
||||
return {
|
||||
'a': 1,
|
||||
'b': 2
|
||||
}.get(numero, "chaine inconnue")
|
||||
|
||||
|
||||
|
||||
fenetre = Tk()
|
||||
value = StringVar()
|
||||
value.set("texte par défaut")
|
||||
entree = Entry(fenetre, textvariable=value, width=30)
|
||||
frame =Frame(fenetre)
|
||||
label = Label(fenetre, text="entrer text ")
|
||||
label2=Label(fenetre, text="")
|
||||
bouton=Button(frame, text="OK", command=click)
|
||||
reset=Button(frame, text="reset",command=click_reset)
|
||||
|
||||
label.pack()
|
||||
entree.pack()
|
||||
frame.pack()
|
||||
bouton.pack(side = LEFT)
|
||||
reset.pack(side = RIGHT)
|
||||
label2.pack()
|
||||
fenetre.mainloop()
|
Loading…
Reference in New Issue
Block a user