Questions tagged [tkinter]

Tkinter is the standard Python interface to the "Tk" graphical user interface toolkit. In Python 3, the name of the module changed from Tkinter to tkinter.

0
votes
0answers
5 views

Ttk Treeview root (parent, top level) nodes invisible

Have been stuck on this for a few days and cannot find any mention of someone experiencing this phenomenon. I have a Treeview and I am population the top level nodes and then sub level nodes but the ...
-1
votes
0answers
7 views

How to display multiple images inside tkinter window?

I want to display 7 different images and plot them inside tkinter window. I only know to display it using OpenCV which actually displays the image outside the Tkinter GUI window. How to plot the ...
0
votes
1answer
6 views

Python Tkinter grids inside Classes

So I'm having this issue where I am trying to place a grid frame INSIDE another grid frame. I was able to pull it off in other programs. But for some reason, I'm not able to replicate this here. I ...
0
votes
0answers
6 views

tkinter treeview how to selected value get single treeview entry

i try selecet and get only Name or Last_Name but where is problem output {'text': '', 'image': '', 'values': [1, 'My Name', 'My Last Name'], 'open': 0, 'tags': ''} dict_values(['', '', [1, 'My Name'...
0
votes
1answer
21 views

Python - Can I use a lambda function to generate a repetitive GUI with tkinter? (labels/text/buttons)

I have a very repetitive GUI to implement - think tens of label/text/button fields, for a data entry form. The sizes of each repeated section can be the same - in fact, everything can be the same ...
0
votes
1answer
16 views

Is there a general animation function in tkinter?

Do you know a function in tkinter to change a general parameter of a widget over time (or for loop)? Like the move function changes its coordinates automatically.Is there something similar with which ...
0
votes
0answers
16 views

Tkinter window doesnt close clicking the “X”-Button

I am learning to handle the tkinter package in the Python programming language in order to create GUIs. Many things work just fine, but often times after creating a tkinter window it won´t close ...
-1
votes
1answer
24 views

How to connect a widget with a button command using Tkinter and Python?

This is my problem: I'm trying to create a GUI with Tkinter that can read multiple files in folders and show their values on the interface. But When I press the widget button nothing happens. This is ...
-2
votes
0answers
7 views

Is there a way to return the dnd widgets inside a certain canvas in python?

I want to try and create a drag-and-drop programming interface inside python using tkinter, that programs a turtle to move around. (I can already make the dnd blocks in python) For example: import ...
0
votes
1answer
18 views

Tkinter multiple tabs: (Multithreading or Multiprocessing)

I am building a tkinter gui program with multiple tabs and perform object detection in each tab. I just wonder shall I use multiprocessing for each tab like Google Chrome or just use multithreading. ...
-1
votes
0answers
14 views

parsing an xml file and populate the values in python tkinter drop downs

I need to parse a xml file and populate those values to the drop downs in python tkinter. The design should be like, the screen should have three dropdowns, when i select country from the first drop ...
-6
votes
2answers
32 views

problem 'Tkinter as tk' imported but unused

read the related questions but I did not understand much, I could say that nothing, I'm aware I'm in a mechanics course at the university, and I have to use a python code for a certain calculation, ...
1
vote
1answer
24 views

“TypeError: Start() missing 1 required positional argument: 'self'”

I do not understand what "TypeError: Start() missing 1 required positional argument: 'self'" means. I require clarification about what this error message refers to and what is required to fix it. ...
2
votes
1answer
16 views

tkinter's .pack method isn't dividing the space properly

Trying to figure out the Packing order. Book says after widgets are given cavity space, expand divides any space left, and fill and anchor stretch and position widgets within their assigned space. ...
0
votes
0answers
25 views

tkinter setting background color failure

I have a window of lines that I select a single line from with a search. I highlight the line and return for processing. When I select another item, I first attempt to unmark the previously ...
0
votes
0answers
9 views

Tkinter Entry is None when calling from another method [duplicate]

I'm trying to get the value of a Tkinter Entry() input field, but for some reason I keep getting None instead of the expected value. I currently have the following code (reduced to show only the ...
0
votes
2answers
16 views

Get input in Python tkinter Entry when Button pressed

I am trying to make a 'guess the number' game with Pyhon tkinter but so far I have not been able to retrieve the input from the user. How can I get the input in entry when b1 is pressed? I also want ...
0
votes
0answers
26 views

Input terminal command to embedded terminal in GUI

I'm pretty new to Python, so bear with me on this. I looked at the possible duplicate of my question, and wasn't able to get it to work for me. I'm assuming I just don't understand the answer code ...
0
votes
0answers
17 views

tkinter radiobutton and mainloop not working in python3

I am working on a python program using Enthought Canopy (for data acquisition). However I have an issue using tkinter when working in the python 3.5 environment. I can not get the values of my radio ...
0
votes
1answer
11 views

Force tkinter listbox to highlight item when selected before task is started

I have a tkinter listbox, when I select a item it performs a few actions then returns the results, while that is happening the item I selected does not show as selected, is there a way to force it to ...
0
votes
1answer
12 views

Tkinter Scrollbar position, yview_moveto() seems not working

Consider the following example: from tkinter import * startingWin = Tk() canvas = Canvas(startingWin, height=600) canvas.grid(row=0, column=0,sticky="nsew") canvasFrame = Frame(canvas) canvas....
0
votes
0answers
22 views

Make the input value of my scale (tkinter ) to be equal to text field input when I click the button [duplicate]

I want the input value of my scale (tkinter ) to be equal to my text field input on click of the button. How can I do that? from tkinter import * def show_values(): temp = inputBox.get() w2....
0
votes
1answer
11 views

How to register values to ttk.Spinbox via keyboard entry?

Can a ttk.Spinbox widget allow a user to type in values to it's entry field and have it registered? If so, how can I do so? I am aware that it is possible to use the .set() method on the ttk.Spinbox'...
-4
votes
0answers
17 views

Exception occured while running the tkinter application in command prompt [on hold]

from tkinter import * from tkinter import messagebox as msg from tkinter import filedialog as fd from tkinter import ttk from tkinter import StringVar as sv class GUI: def __init__(self,master): ...
-4
votes
1answer
42 views

Function only works once python

i use the tkinter as a class with function, bur when i run one function that leads to another function, that again ends with running the first funktion again, but then the original function does not ...
0
votes
1answer
22 views

Closing a second Tkinter window doesn't work

Imagine the following very simple example: from tkinter import * from tempFunctions import * startingWin = Tk() button = Button(startingWin, text="Open Other Win", command=lambda: openSecondWin())....
0
votes
2answers
17 views

Changing the colour of button border with python tkinter

I'm trying to change the color of my border on this button however it does nothing or gives me a grey border. self._lqbutton = tk.Button(self._longquestionframe, text="...
-1
votes
0answers
9 views

Tkinter Entry receiving alphabets only [duplicate]

Please in tkinter Entry if you want the user to enter only alphabets such that when he enters anything apart from the alphabets it shouldnt show in the Entry.
-2
votes
0answers
15 views

How can you get Tkinter to create more than one messagebox at one time?

I'm trying to create a virus that continuously creates Tk message boxes. However it doesn't seem to create more than one at a time, is there any way of getting around this? Here is my code: from ...
1
vote
3answers
30 views

Creating a bulleted list on a label widget using python tkinter

Is there any way to create a hanging indented list using the tkinter label widget? Note: Using propper standard bullets not * or -.
0
votes
0answers
20 views

PyInstaller Runs but returns an empty .exe file

I have created a Python code which has about six sub .py files which contain sub functions for my script. It is a very long and complex GUI. When I run it through PyInstaller I get no errors and it ...
-2
votes
0answers
21 views

button text of tkinter not works in mojave

It is very simple program. import tkinter tkinter.Button(None, text='button').pack() tkinter.mainloop() I expect this program shows me such as a below picture. But it shows a below picture actually....
-2
votes
1answer
76 views

Tkinter or Pygame? Which is better for creating a classic Atari game? [on hold]

I am trying to make Pong in python, and a friend is raving to me about tkinter. However I have dabbled more in Pygame. Should I use pygame or tkinter for this project? I have seen other posts similar ...
-1
votes
0answers
30 views

tkinter - better solution than import and delete a module?

I have a question because i think the solution how i have done it is really stupid. it seems to work but im not sure if this is fine or there will be slowing down the computer over time if it has a ...
0
votes
2answers
29 views

Using Tkinter I am trying to add a user-entered value and add it to a value that exists in a file, but it isn't working

I am trying to create a very simple loyalty program for my small business. This is my first project in Python or Tkinter. The #POINT ENTRY section below lets the user enter in the appropriate amount ...
0
votes
2answers
29 views

How to Randomize the button location in python using tkinter?

I am trying to create a clickable word cloud for which I am starting to apply logic with button. I am able to split the words of text file using regular expressions and create button for each word. ...
-2
votes
0answers
17 views

How to reset my window to start stage in tkinter?

I had 3 buttons in one window. each will shows different labels when clicked. If i go to second button and return to first the the labels showed in second are not hided. How to reset it?
-1
votes
0answers
10 views

Python tkinter destroying a label

I know there have been many sources that have shown how to use the destroy command but for some reason this ignores the destroy command and continues to create more text labels. Any ideas on why this ...
-3
votes
0answers
16 views

AI function fires on itself in python battleships game with tkinter

I am creating a battleships game in python with tkinter. Currently the board consists of a list with lists of "~" and "around" it is a border of "#". The border is there to check that a ship can be ...
0
votes
1answer
17 views

Combining selenium test class and tkinter

This is my first attempt at using the Tkinter plugin, I know very little past what tutorials I could find. All the answers I've seen so far put a class inside the py file that your building, I however ...
3
votes
1answer
21 views

Tkinter program doesn't work when double-clicked

I am pretty new to tkinter and made a simple little program: ! python3 from tkinter import * import tkinter.messagebox import time checked = False pressed = False rthat = False rthat2 = False fe = ...
1
vote
0answers
26 views

Pytest Tkinter Messagebox

My program generates an Alert / Message Box using the code below. import tkinter as tk from tkinter import messagebox root = tk.Tk() root.withdraw() messagebox.showwarning('End of Data', "You have ...
-1
votes
1answer
23 views

tkinter tkcalendar to display events

I am trying to use tkcalendar to display some events in my python tkinter application. I have a database of events and i put them in the calendar as in the following example (I have created a ...
-2
votes
0answers
12 views

Python Tkinter Canvas does not create image [duplicate]

I have a larger GUI I am making. I am trying to display a picture from a different folder, than the one where the program is wirtten in. While all the other canvas' I am using work, this one will not ...
0
votes
0answers
15 views

Modifying treeview column width after creation

I want to use the same tree widget for different reports. To make this work I need to modify the header every time before inserting new data. But I can't get the widget to behave the way I want it to: ...
1
vote
3answers
40 views

PhotoImage no such file or directory error

So basically, I am trying to learn tkinter but the PhotoImage gadget won't work. My code: import tkinter as tk root = tk.Tk() logo = tk.PhotoImage(file ="monky.gif") def test(): print("Hello ...
1
vote
0answers
13 views

Combining browse method with os.listdir file sorting script

I'm a novice python programmer and i found two pieces of code that combined would basically do what i want from the program i am building. But i have a problem to get them working together. ...
1
vote
1answer
22 views

python expression to latex

I'm trying to display equations by using GUI. I use latex and canvas. However, I'm getting an error message ValueError: KeyPress event keysym=Return keycode=36 char='\r' x=266 y=8 it should be ...
1
vote
1answer
31 views

Python - Making a button change position randomly

I need to be able to change the button position when I click on it. The position changes by a random amount each time I click on it. But all i get is an error. Here's my code: from tkinter import * ...
-1
votes
0answers
14 views

Tkinter Button with blinking LED

i am working on a gui-panel on python an a raspberry pi which controls the light-system of a toy car. the idea was to set up a gui with different colored buttons and when you press one it stays ...