Skip to content

Instantly share code, notes, and snippets.

@Franck1333
Created July 20, 2019 15:26
Show Gist options
  • Select an option

  • Save Franck1333/0416417cbcc2491e8a0d0e7fd9aeea89 to your computer and use it in GitHub Desktop.

Select an option

Save Franck1333/0416417cbcc2491e8a0d0e7fd9aeea89 to your computer and use it in GitHub Desktop.
TKINTER | Get data from a textBox widget
#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