Relative Content

Tag Archive for pythontkinter

permanent virtual numpad in tkinter

I am using Python 3.11.9 on windows OS. I want to create button in tkinter which when pressed add text to entry i selected before clicking the button. Here is my example code from tkinter import * class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) frtop=self.winfo_toplevel() #Flexible Toplevel of the window screen_width = self.winfo_screenwidth() screen_height = […]

How to display an image in the first colum of TreeView

I’m working on a Python application using Tkinter that includes a ttk.Treeview widget with two columns: “Streamer Name” and “Status”. Each row in the treeview represents a streamer, and I want to enhance it by displaying an image in the first column alongside each streamer’s name.

Python Tkinter: Change button position based on window size

This is just a concept that I haven’t actually programmed yet. I’m still learning the logic for Tkinter and I’m wondering how to Change button position based on the window size. The best thing I can compare my idea in my head is something similar to word wrap.

Tkinter – resize the window with custom constant side position

when a window in Tkinter is resized, the new position is the made by taking the top left position and from there expanding on it (toward right side and bottom side of the screen) the window size.
Easier explanation (top left will still be top left).
so I’m curious if you can change that condition to a different point on a specific window resize – (bottom left, etc.)

Tkinter bind command to Listbox delay

recently I’ve made a global function for my program (instead of many locals) that when pressing on a Listbox item -> it will put its text inside the entry widget, kind of “autocomplete” method (like in the image).
enter image description here
the problem that I’m facing is that now when I made the local “autocomplete” functions into one global one there’s delay by one iteration between the Listbox item that you’re clicking to the text that it will output to you in the Entry widget.

vlookup using .py file,taking input files and column from user

import pandas as pd import tkinter as tk from tkinter import filedialog, messagebox def select_file(): file_path = filedialog.askopenfilename(filetypes=[(“Excel files”, “*.xls *.xlsx”)]) if file_path: return file_path else: messagebox.showwarning(“No file selected”, “Please select a file.”) return None def load_columns(file_path, listbox): df = pd.read_excel(file_path, None) columns = df[list(df.keys())[0]].columns.tolist() listbox.delete(0, tk.END) for col in columns: listbox.insert(tk.END, col) return df […]

Tkinter freezing when using it to send serial data

I’m making improvements to some previously written code for a tkinter GUI that allows the user to setup some hardware graphically rather than entering the commands manually through CuteCom (a serial terminal), as well as providing some level of automation through config files. In short, the GUI takes the user through a few pages where they enter various settings or select a config file containing the settings they want, and on the last page they hit an “install” button. After clicking install, the program looks for the prompts coming over the serial port and then sends the corresponding commands according to the settings the user selected on the previous pages.