Created
July 20, 2019 15:26
-
-
Save Franck1333/0416417cbcc2491e8a0d0e7fd9aeea89 to your computer and use it in GitHub Desktop.
TKINTER | Get data from a textBox widget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #AIDES: https://stackoverflow.com/questions/14824163/how-to-get-the-input-from-the-tkinter-text-box-widget | |
| from tkinter import * | |
| fenetre=Tk() | |
| #----------------------------------------Zone de Recherche Manuel---------------------------------------- | |
| #Bar de Recherche | |
| textBox=Text(fenetre, height=1, width=13) | |
| textBox.pack() | |
| Button(fenetre, height=1, width=13, text="Go!",command=lambda: recuperation_input()).pack() | |
| #command=lambda: recuperation_input() >>> just means do this when i press the button | |
| #Fonction permettant de recuperer la valeur écrite dans la bar de recherche par l'Utilisateur | |
| def recuperation_input(): | |
| received_data=textBox.get("1.0","end-1c") | |
| print(received_data) | |
| #----------------------------------------Zone de Recherche Manuel---------------------------------------- | |
| mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment