Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
111 views

I'm trying to create a square tk.Entry widget in Tkinter, but the width parameter only accepts integers which represent a number of characters instead of pixels. Setting width=2 makes the box too ...
Stevoisiak's user avatar
  • 27.8k
-1 votes
1 answer
63 views

I'm attempting to learn tkinter, how can i edit this code so that the text box is directly next to the input statement ? I've tried putting the text box in the first column with an alignment to the ...
Stuff's user avatar
  • 8
1 vote
0 answers
55 views

I seem to be always getting 120 for both height and width, I don't know why it refuses to give me the real value for the width so I can make the maintain the height in a 16:9 ratio # Monitor frame ...
epi's user avatar
  • 11
1 vote
0 answers
71 views

I'm trying to create a short form in tkinter python but am new to the language. Whenever I click off of the text box the text underneath moves down vertically and the error message displayed has a ...
Stuff's user avatar
  • 8
0 votes
1 answer
46 views

import tkinter as tk from tkinter import ttk root = tk.Tk() def change(): img2 = tk.PhotoImage(file = "img2.png") label.configure(image = img2) img1 = tk.PhotoImage(file = "...
Ingrid Ledingham's user avatar
0 votes
1 answer
99 views

Button is created like: style.configure('Dark.TButton', background=button_base, foreground=colors['text'], borderwidth=1, bordercolor=edge, lightcolor=edge, darkcolor=edge, padding=...
Maj mac's user avatar
  • 63
1 vote
3 answers
67 views

I want that when I upload a file, the label changes its name to file name to filename name. #File class class File: def __init__(self): self.filename = None def getFile(self): ...
v0id0100's user avatar
Best practices
2 votes
1 replies
34 views

How can I treat a file when the client imports a local file as a variable and using it later? def getFile(): return filedialog.askopenfilename() from operation.encryption import getFile ...
v0id0100's user avatar
Best practices
0 votes
3 replies
63 views

I have this script in Tk and it works fine. I wanted to make it dark and add hover options, so I changed it to CTk, but now it's not working. Can someone please help me fix this? I have both scripts ...
Royy's user avatar
  • 149
0 votes
1 answer
51 views

I want to put the "Selecto a file to encrypt" on the left site, a try it separate too and it didn't work. tk.Label(frame, text="Select a file to encrypt: ", fg="black")....
v0id0100's user avatar
0 votes
3 answers
66 views

I'm new into tkinter and I don't know how to put this Label: tk.Label(frame, text="Select a file to encrypt: ", fg="black").pack() Into that frame: frame = tk.Frame(root, width=...
v0id0100's user avatar
0 votes
1 answer
60 views

I have a tkinter window that runs script, with this general layout: ┌─────────────────────────────────────┐ │ Op Buttons │ ← Row 0 (fixed) ├───────────────────────────────────...
Smorkster's user avatar
  • 357
0 votes
0 answers
84 views

I'm in a CS class for college right now, and we've gotten to the part in our Python course where we learn how to read, write, and append to external files. We were given some class work where we have ...
Dominic B.'s user avatar
-1 votes
0 answers
51 views

This happens after selecting a date from the DateEntry popup. If you type a date into the DateEntry widget the exit routine shuts the toplevel correctly. Select a date from the popup and the exit ...
Larry Plazo's user avatar
0 votes
2 answers
78 views

I wanted to try to use tkinter for the first time, and had a little program I wanted to try. It needed some text in a "table" and because of the number of rows and columns, I needed ...
TTM's user avatar
  • 21
0 votes
0 answers
66 views

I bind the enter-event to a Tkinter canvas widget. But it seems that Tkinter on Windows 11 and Tkinter on Linux Mint handle the event differently. In my example the enter-event is bound to the green ...
Matthias Schweikart's user avatar
1 vote
1 answer
66 views

I am struggling with some key bindings in Tkinter. In my application, to avoid having to make each widget get the focus prior to having the opportunity of capturing KeyPress events, I decided to use ...
Mike Duke's user avatar
  • 235
0 votes
1 answer
70 views

Running VSCode with MS Python extension and my window will not display here's my code import tkinter as tk class FormMain: def __init_(self): self.build_controls() def build_controls(...
Randino's user avatar
  • 41
1 vote
0 answers
41 views

I want to remove the box surrounding the arrow of a combobox, seen below I am using ttkinter with the theme "Clam", and styling it like this: combobox_style = ttk.Style() ...
Juan Calvo Franco's user avatar
1 vote
3 answers
105 views

I am using Python 3.14 on Windows 11. I have 2 frames (left and right) inside a top Frame, and there is also a bottom Frame that will act as a status bar. I want the left frame to be a square, giving ...
Mike Duke's user avatar
  • 235
0 votes
0 answers
36 views

from tkinter import * from tkinter import filedialog from tkinter.ttk import Progressbar import pytubefix.exceptions from pytubefix import YouTube import time def openFile(): global filepath ...
Will's user avatar
  • 21
2 votes
0 answers
57 views

I'm building a Python desktop app that uses both pystray (for a system tray icon) and Tkinter (for message boxes and dialogs). Everything works fine except for one issue on Windows 11: when I open a ...
Camilo Garcia's user avatar
0 votes
1 answer
31 views

The Messagebox shows up as it does under windows - but only shows the title not the message. I have created a simple piece of code to illustrate the problem: from tkinter import * import ttkbootstrap ...
Terry Wright's user avatar
1 vote
1 answer
128 views

I'm building a multi-frame Tkinter app for a school project (NEA dashboard). One of the frames displays a Matplotlib scatter plot using FigureCanvasTkAgg. The issue is that after switching to the ...
chaz2431's user avatar
0 votes
1 answer
140 views

I want to have fixed width frames with tkinter. The main idea is to have a dynamic number of fixed width columns (in this example 2) and within each columns a dynamic number of entries (in this case a ...
Gabor's user avatar
  • 1,509
1 vote
2 answers
104 views

import tkinter,time canvas=tkinter.Canvas(width=500,height=500,bg="white") canvas.pack() canvas.create_text(250,250,text="0:0:0",font="Arial 70 bold") global b def ...
Faith's user avatar
  • 11
2 votes
2 answers
86 views

I'm trying to catch/save the text widget state (for use later) before it is destroyed by binding it to the <Destroy> event, for example: import tkinter as tk root = tk.Tk() text = tk.Text() text....
Patrick Kwok's user avatar
1 vote
2 answers
101 views

I wrote a game with python tkinter but i don't know def stop?? I want to stop the game for seconds and then start again from where it was stopped. I want to press SPACE key and then the game stops and ...
Fatima's user avatar
  • 23
0 votes
1 answer
106 views

I am working with tkinter and I want to use three windows: startWindow addWindow deleteWindow I want to start them separately, but when I run my code, all three windows start immediately. How can I ...
David Diethelm's user avatar
0 votes
1 answer
134 views

I am using tkinter, pandas and treeview. The treeview is to display an excel file via filedialog with 15 columns, which is very lengthy, hence I needed a horizontal scrollbar. However the scrollbar ...
user2741620's user avatar
2 votes
2 answers
101 views

My program gets a list of messages and displays them on a Tkinter widget. "Previous" and "Next" buttons let me read through the message list. I can read all the messages and ...
Mike Duke's user avatar
  • 235
1 vote
2 answers
115 views

I want to make a Tkinter program where separate users can load their data, (a dictionary) from a sub-folder within the main project directory. My_project |_main.py | |_User_data | |_ Data.py ...
JohnnyLaw's user avatar
0 votes
1 answer
89 views

I have an tkinter application with several windows, which often are placed over each other in a window stack, so that only a topmost window is visible. In this topmost window I can press a button ...
Matthias Schweikart's user avatar
2 votes
1 answer
80 views

Good evening, I would like to build a tkinter interface with several buttons leading to differents script. Those script are functions in another folder. In the example I built to explain my problem, ...
seb66's user avatar
  • 25
1 vote
2 answers
113 views

I'm trying to make a Student Information System, the information will be stored in a text file, and will be shown through a table. Submit button function: def submit(): if idEntry.get() == "&...
uxzane6225's user avatar
3 votes
1 answer
104 views

In Tkinter want to import variables stored on a file in a sub directory of the main project but am having trouble. I can read the file, but cannot import variables. Please Help. def change_dir(): ...
JohnnyLaw's user avatar
0 votes
0 answers
54 views

I managed to style a treeview control to this nice gridview: container = tk.Frame(self, relief='sunken', borderwidth=1, bg='white') container.grid(column=0, row=0, sticky='nsew') container....
Daniel's user avatar
  • 2,734
5 votes
1 answer
74 views

In tkinter I wish to achieve the above goal. I can perfectly get 50-50, and 25-25-25-25. But tried everything to get 25-25-50 without success: import tkinter as tk root = tk.Tk() root.geometry("...
Daniel's user avatar
  • 2,734
2 votes
2 answers
128 views

Is it possible to sort 0:5 to frame 1, and sort 5:10 to frame 2 using one list? Now it is clicking both radiobuttons in frame 1 and 2. I would like that only one can be selected at the time. My code: ...
Royy's user avatar
  • 149
1 vote
1 answer
79 views

I have two lists, but I want them to work as one. So only one radiobutton can be activated at the time. I am trying to get them to print something without an error, but I keep getting an error because ...
Royy's user avatar
  • 149
9 votes
1 answer
410 views

These lists aren't expanding, only the last thing on the list is visible. My list works when I use it as pack. But I want to have 3 lists right next to each other with radiobuttons using grid. But I ...
Royy's user avatar
  • 149
1 vote
1 answer
53 views

I'm trying to add items to the combobox in GUIzero getting the value from a textbox when a button is pressed, but when the button is pressed I get the following error: Exception in Tkinter callback ...
Alfonso's user avatar
  • 57
1 vote
1 answer
163 views

How can I get the value options for config attributes? Especially those that take set values, i.e. anchor, relief, etc. Call the configure method on some widget, say a label: label = tk.Label(root, ...
Mote Zart's user avatar
  • 970
4 votes
1 answer
144 views

I am developing an app to select and play a mp3 clip from a list. It will be run on a Pi4 with 7” touch display and piAMP+ hat. The GUI is in tkinter with pygame for the sound plus a pair of GPIO pins ...
Cheesehead's user avatar
-1 votes
2 answers
115 views

I want to creates buttons in a while loop, but when the app starts running, my program stops. It might be a beginner problem, but I cannot figure it out. My code looks like this: import tkinter as tk ...
Randsome's user avatar
0 votes
1 answer
116 views

I'm new here and this is my first question! So I have this simple Python snake game that uses tkinter and tkSnack and it's working as intended graphics and controls wise except that the game or frame ...
Zen's user avatar
  • 1
-2 votes
1 answer
83 views

I have a slider to change the volume on my PC when I change the scale. However, it doesn't set the volume at the moment and I don't know why. Can someone please help me? My code: from tkinter import * ...
Royy's user avatar
  • 149
0 votes
1 answer
121 views

so I'm a bit of a beginner in python and wanted to make a GUI for a script I'm using to make it easier. For the data input I created a frame in which I placed the filedialog button etc., and ...
Sarius's user avatar
  • 1
0 votes
0 answers
93 views

I’m building a flashcard app with Tkinter in Python on macOS (macOS 26 + Python 3.13). I’m trying to make an x_button that shows only an image without any border, background, or focus ring. Here’s a ...
user avatar
1 vote
1 answer
111 views

I have a callback from tkinter import font, ttk class Foo(ttk.Frame): def set_font_cb(self, event: tk.Event) -> None: event.widget.configure(font=font.Font(...)) And this creates in ...
fsdfsdfsdfsdfsdf's user avatar

1
2 3 4 5
1055