commit f44d3a16ceb6deb89c4173fb632e6fefcb4f9fc6 Author: vincent Date: Sun Jan 21 21:15:24 2018 +0100 first commit diff --git a/test.py b/test.py new file mode 100644 index 0000000..33b2993 --- /dev/null +++ b/test.py @@ -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()