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
2
votes
2 answers

Directly handle Tkinter Entry input without Button?

I am writing some GUI code with the tkinter module. My problem is that I want to read the entry input, without clicking a Button. So that the entry input is going to be written to a .txt file automaticly. for example: If I type in 'a' , the text…
JimmeyNeutron
  • 57
  • 1
  • 5
2
votes
1 answer

How to put the value of an entry into a variable in tkinter

I'm trying to get the value of an entry in tkinter! when I print the value directly ( for example print(e2.get() ) it works well, but when I put this into a variable and then print it ( for example x = e2.get() print(x) ) it's not working! here is…
f ebrahimi
  • 25
  • 4
2
votes
2 answers

How do I get a bytearray from a Tkinter entry widget

I have a need for a tool to spit out commands to a telnet device that requires none printable chars, such as carriage-returns and line-feeds. In python itself this is achieved with something like the following.... myDevice.send(b'command\n\r') This…
2
votes
1 answer

Tkinter entrybox, not allowing typing and showing one string at a time

I am trying to make a entrybox that gets keyboard input when it is focused, and show only that key name in the middle of the box with no blinking bar and not allowing editing. And also changes a variable to the key. So if [ ] is a entrybox. I…
Moses Kim
  • 242
  • 3
  • 16
2
votes
1 answer

How to keep i when calling a function assigned to a StringVar().trace inside a loop?

So I want to use trace() inside a loop. The problem is the function that gets called by the trace passes on variables using the i. It results in only the last string Var in the list being called, instead of all. What the program is meant to do is…
2
votes
1 answer

Focusing on next entry box after typing a number in current entry box

I'm trying to see if there's a way to type a number between 1 and 4 into an entry box, then go to the next entry box (with the number entered into the box; the code below skips to the next entry without entering anything) I'm creating a program that…
B Flynn
  • 23
  • 3
2
votes
1 answer

Interactively validating Entry widget content in tkinter (part 2 - change the properties of the entry object)

I'm trying to use the validation procedure from the answer here: Interactively validating Entry widget content in tkinter I want to change the background color by checking the input type. Unfortunately, I can't pass the entry pointer to the…
Alexander Korovin
  • 1,639
  • 1
  • 12
  • 19
2
votes
1 answer

python3 tkinter Entry() cannot select text field until I click outside app window once

I've written a very simple app with python3, tkinter, but am seeing some strange behaviour with Entry(). I'm new to tkinter and python. import os from tkinter import Tk, Entry, filedialog class MyGUI: def __init__(self,master): …
Rob
  • 31
  • 3
2
votes
1 answer

Python - Deleting a line from a file (To-Do List program that uses entries, different from other posts)

I have a problem with my code. I am trying to delete a specific line from a file. I am making a To-Do List program in Tkinter, and I am using a Label as the to-do list. I have two buttons, 'Add Item' and 'Delete Item'. I also have an entry box, and…
Rohan
  • 543
  • 6
  • 14
2
votes
1 answer

Adding all the tk.Button objects to a list to config

So I'd like to add all the tk.Button(and entry) objects in an entire program to a list. (so that I can change the colours of every button though iterate and config) I'm creating a bunch of tkinter frames like this: class AppClass(tk.Tk): def…
David W. Beck
  • 182
  • 1
  • 9
2
votes
1 answer

Python Tkinter Format Number Entry with commas

I would like to know how to convert a number into a formatted "number" format that has commas. I am on Mac OSX. An expression is inputted and evaluated within an entry widget and then output into a label widget with the following function: def…
oezeadi
  • 77
  • 1
  • 7
2
votes
0 answers

ttk customize 'vista' theme adding black borders to entries

Using the 'clam' theme I can do that with the following command: style.configure('TEntry', bordercolor='black') But it doesnt work with the 'vista' theme Example: import tkinter as tk from tkinter.ttk import * from tkinter import ttk root =…
Gutimore
  • 365
  • 3
  • 10
2
votes
3 answers

Python 3 Tkinter: NameError with Entry widget: name 'Entry' is not defined

I am writing a GUI on Python 3 using Tkinter, but every time I use Entry(), I get a name error. I tried a more simpler version of the code, (which is written below), but it still caused a NameError: import tkinter top = tkinter.Tk() e =…
Bill Reason
  • 391
  • 1
  • 5
  • 13
2
votes
2 answers

Tkinter entry text justification after insert

Using Python 2.6.1 or 2.7.9 Tkinter's Entry widget entry.insert seems to destroy left justification. How do I get the text to stay left justified? Specifically, after entry.get() provides what I type into the widget, I insert additional text…
Brian
  • 115
  • 8
2
votes
1 answer

Focus Events (or lack thereof)

I am having a hard time understanding the focus events for Entry and Textbox fields in Python version 3 using Tk. I eventually need to validate an Entry box on lost focus if I click a radio option or a button. If you run the code below then (which…
Dr Jeep
  • 43
  • 3