Questions tagged [tkinter-entry]

Tkinter Entry refers to a type of widget used in Tkinter (a Python standard GUI package), called the Entry widget, used to enter or display a single line of text. Not to be confused with the Text widget which is used to enter multiple lines of text. Use this tag for questions related to the Entry widget.

Tkinter Entry refers to a type of widget used in Tkinter (a Python standard GUI package), called the Entry widget, used to enter or display a single line of text. Not to be confused with the Text widget which is used to enter multiple lines of text. Use this tag for questions related to the Entry widget.

1335 questions
55
votes
6 answers

How to set the text/value/content of an `Entry` widget using a button in tkinter

I am trying to set the text of an Entry widget using a button in a GUI using the tkinter module. This GUI is to help me classify thousands of words into five categories. Each of the categories has a button. I was hoping that using a button would…
unlockme
  • 3,897
  • 3
  • 28
  • 42
27
votes
6 answers

Why is Tkinter Entry's get function returning nothing?

I'm trying to use an Entry field to get manual input, and then work with that data. All sources I've found claim I should use the get() function, but I haven't found a simple working mini example yet, and I can't get it to work. I hope someone can…
CodingCat
  • 4,999
  • 10
  • 37
  • 59
20
votes
1 answer

How do you check if a widget has focus in Tkinter?

from Tkinter import * app = Tk() text_field = Entry(app) text_field.pack() app.mainloop() I want to be able to check if text_field is currently selected or focused, so that I know whether or not to do something with its contents when the user…
cstack
  • 2,152
  • 6
  • 28
  • 47
19
votes
2 answers

How do I get the Entry's value in tkinter?

I'm trying to use Tkinter's Entry widget. I can't get it to do something very basic: return the entered value. Does anyone have any idea why such a simple script would not return anything? I've tried tons of combinations and looked at different…
Evan
  • 1,960
  • 4
  • 26
  • 54
18
votes
1 answer

Tkinter set focus on Entry widget

Here is my code: import tkinter as tk userData = tk.Tk() nbdays = tk.IntVar() mainframe = tk.Frame(userData, relief= 'raised', borderwidth=1) tk.Label(mainframe, text = 'Number of days', font = 10).place(x=2, y = 30) tk.Entry(mainframe, width= 8,…
Cyrus TNZ63
  • 209
  • 1
  • 2
  • 6
17
votes
8 answers

tkinter python entry height

I'm making a simple app just to practice python in which I want to write text as if it were Notepad. However, I can't make my entry bigger. I'm using tkinter for this. Does anybody know how to make the height of an entry bigger? I tried something…
Abdul Hamid
  • 168
  • 1
  • 7
  • 25
14
votes
2 answers

Get contents of a Tkinter Entry widget

I am creating an application and I want to use the entered values in the GUI Entry widget. How do I get the entered input from a Tkinter Entry widget? root = Tk() ... entry = Entry(root) entry.pack() root.mainloop()
user1786283
13
votes
2 answers

Using tkinter to input into a variable, to be called

I'm currently working on a scraper-sort of program, which will enter a Wikipedia page, and in its current form, will scrape the references from the page. I'd like to have a gui that will allow the user to input a Wikipedia page. I want the input to…
Bocui
  • 459
  • 1
  • 3
  • 12
13
votes
4 answers

Tkinter check if entry box is empty

How to check if a Tkinter entry box is empty? In other words if it doesn't have a value assigned to it.
SkyDrive26
  • 191
  • 2
  • 3
  • 8
12
votes
3 answers

How do I set the width of an Tkinter Entry widget in pixels?

I noticed that the width argument for the Tkinter entry widget is in characters, not pixels. Is it possible to adjust the width in pixels?
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
11
votes
3 answers

How can I insert a string in a Entry widget that is in the "readonly" state?

I am trying to obtain an Entry that starts with an ellipsis .... Here was the code I tried: e = Entry(rootWin, width=60, state="readonly") e.insert(0, "...") I think the error is occurring because I am trying to insert text after the object has…
sixglazed
  • 415
  • 2
  • 4
  • 8
10
votes
2 answers

How to bind enter key to a tkinter button

I am trying to bind the Enter key with a button. In the bellow code, I am trying to get entries from the entry widget, when the button bt is pressed, it calls theenter() method which gets the entries. I also want it to be called by pressing the…
Rahul
  • 230
  • 1
  • 3
  • 15
10
votes
1 answer

How to connect a variable to Entry widget?

I'm trying to associate a variable with a Tkinter entry widget, in a way that: Whenever I change the value (the "content") of the entry, mainly by typing something into it, the variable automatically gets assigned the value of what I've typed.…
Sano98
  • 419
  • 2
  • 7
  • 17
10
votes
1 answer

How can i change the font on ttk.Entry

Is there any way to change the ttk.Entry font I've tried with the ttk.style but TypeError occurs. Like: my_style = ttk.Style('TEntry' , font = ('Arial' , 10 , 'bold')) my_entry = ttk.Entry(master) my_entry.pack()
L0aD1nG
  • 111
  • 1
  • 10
7
votes
4 answers

How to insert a temporary text in a tkinter Entry widget?

How to insert a temporary text in a tkinter Entry widget? For example, I have a Label User and next to it I have an Entry widget which should have some text "Enter your username..." at the beginning of the application, and while putting cursor on…
Ds Arjun
  • 409
  • 2
  • 7
  • 16
1
2 3
88 89