I am currently facing an issue with the three radio buttons. They all allow multiple selections at once. How can I prevent this behavior and make it so that when one button is pressed, the selection switches from the previously selected one? pen_size ...
Encountering the error message "Global name 'start' is not defined" from the code snippet provided. Interestingly, the call to start(panel) within displayImage(img) is responsible for displaying the desired image in the GUI; without it, no image appears. D ...
Whenever I attempt to upload an image using tkinter, I encounter an error. I have fetched a gif image and stored it in a file named "image.gif", and saved the picture as "image". #Displaying image using label logo = PhotoImage(file="img.gif") w1 = Label(n ...
I have been working on creating a selection page at the top of my root page in an App using the tk.Toplevel() function in tkinter. The new page features an add button which generates new options on the selection page. Here is a simplified version of my cod ...
Can you select multiple rows in a treeview widget and how do you retrieve the selected rows? I've created a treeview, but I can't seem to figure out how to select multiple rows at once. https://i.stack.imgur.com/lH43J.png If selecting multiple ...
I am facing an issue with two Text widgets placed in a tkinter window. The empty border of the second line is obscuring part of the first line. Even after checking http://effbot.org/tkinterbook/text.htm, I found that all default border settings are set to ...
My main objective at the moment is to have the last section of the directory displayed in a drop-down menu as text, while still being able to open the image through the complete directory path. Currently, my drop-down menu only displays the full directory ...
I have designed a listbox feature and I am seeking to adjust the functionality of the Left and Right arrow keys. Currently, these keys are programmed to navigate horizontally within the listbox, but I want them to move up and down the list instead. How can ...
I created this code with the intention of quickly pulling and displaying data from Wikipedia. Everything functions well unless the summary from Wiki is too extensive for the box to present all at once. I believed that including sticky = N+S+E+W would resol ...
As a beginner in tkinter, I find myself struggling to grasp the concepts of frame, self, and so on. This is what I currently have: class ScalesPage(Frame): def GetNotes(): key = KeyEntry.get() intervals = ScaleEntr ...
I'm encountering an issue with my code that involves the following line: self.button = Button(frame, text="CALCOLA", width=28, height=2, command=callback) When running the code on OSX, the button appears as a single line separated above and below from ot ...
I recently used Pyinstaller to convert my Python script into a stand-alone executable program. However, I encountered an issue where the exe version of the program did not work as expected, even though it ran perfectly fine in spyder during testing. Progr ...
Currently, I am developing a tkinter application that automatically backs up files by monitoring the last modification time of the file. The code for this app is provided below. from tkinter import * from tkinter import filedialog import shutil import os f ...
During code execution, when the snake and food coordinates are identical, the expected behavior is to delete the food item, increase the score by 1, add another square to the snake, and create a new food object. However, the `if` statement in the `next_t ...
My latest project involves creating a library program that uses a database to store information about books, complete with tkinter for the graphical user interface. One highlight is a feature where users can input a book's name in order to search the datab ...
import tkinter as tk from tkinter import * import tkinter.ttk class main_window(Frame): def __init__(self): tk.Frame.__init__(self) self.pack() self.master.title("MANAGEMENT") self.entry_button = But ...
After working diligently on this code, I have come up with the following structure: def fee_foo(): fee_screen = tk.Tk() fee_screen.title("Fee Information") fee_screen.geometry("500x500") # Running the SELECT statement and ...
Disclaimer: I have modified code found on the internet by adding a Regex function. I am interested in identifying numbers within text and replacing them with a 'number' tag using Regex. The code below accomplishes this task, utilizing tkinter to ...
Having a bit of an issue here. The goal of my project is to sum up certain columns from the SQLite database and display the results in an entry box based on the checkboxes (representing months and years) selected by the user in the main GUI. I am able to g ...
I am having trouble updating my label based on the position of the mouse. Currently, it only works once when I run the code. How can I make sure the label updates every time my mouse changes position? The following code snippet is what I have so far, but i ...
How can I modify the structure to recolor the circle when clicked with the mouse? import tkinter as tk class CanvasEvents(tk.Tk): def __init__(self): super().__init__() self.geometry('510x510+700+100') self.title("Event&qu ...
My Current Project At the moment, I am developing a graph-viewing application. The user experience starts with opening the app and clicking on 'Import' in the sidebar to choose a CSV file. Once selected, the user can view the graph embedded with ...
import tkinter import tkinter.messagebox import sys top=tkinter.Tk() from tkinter import* def clear(): e1.delete(0,END) return def seven(): v.set(v.get()+str("7")) v.get() def eight(): v.set(v.get()+str("8")) v.get() def ni ...
How can I modify this code to make it functional? import os import time import random import sys import string import tkinter as tk root = tk.Tk() root.geometry("400x400") root.title("RandomPass v1.0") welcome = tk.Label(root, text="Welcome to RandomPas ...
I am encountering an issue where I am trying to retrieve the selected date from a tkcalendar calendar, but it keeps throwing an error that says AttributeError: 'NoneType' object has no attribute 'get_date'. I am unsure of what is causing this problem. Can ...
I am looking to enhance my program by checking if an index in a Text widget has a tag attached to it. If a tag is present, I want the program to insert a different character based on that tag. This issue arose from my previous question which can be found h ...
After spending some time utilizing this website, I must say it has been incredibly beneficial for my Linux and Python needs - so thank you :) Recently, I embarked on the journey of adding a background to an application window. I created a button that trigg ...
I am attempting to open web links from a list box by double clicking on them. Currently, I have code that would work if a button was used to call the function. However, I now want to simply double click on the link: def internet(): weblink = lb2.get( ...
My code is intended to display a keyboard design with 4 rows and 16 columns. https://i.stack.imgur.com/Guu5r.png In the provided image, there seems to be an issue with one of the buttons ('A') missing from its expected position in the top right corner. Ca ...
Recently, I developed a basic Tkinter program to assist in grading students' tests. The program is designed to calculate the points for a specific grade based on the maximum number of points provided. While I have managed to create a list or dictionary ma ...
Is it possible to use time as x-axis values for a live matplotlib graph? If so, how should it be implemented? Despite trying various methods, I keep encountering errors. Below is my current code: update_label(label): def getvoltage(): f=ope ...
After creating a basic GUI using the tkinter library, I implemented a feature that opens a new thread with Selenium when the user clicks on a button: In the start_button3_callback method: # Initiating a new thread to run the button3_callback function in t ...
Encountering a problem with my OptionMenu where it's not working unless I use a placeholder label to get it to function. In the example below, it only works when using TaxYear as the master, not TaxYearLi. The second issue is that for some reason w.s ...
After implementing a Tkinter canvas object with a zoom feature, based on guidance from another post on Stack Exchange and making some modifications, I encountered an issue. The zoom function in question is as follows: def wheel(self, event): ' ...
I'm currently working on a project involving buttons and I want to ensure it is modular. However, I've encountered an issue regarding detecting button presses from different files. - File 1 from tkinter import* class app2: def __init__(self) ...
Here is a sample code snippet: from tkinter import * import numpy as np rows = 10 columns = 10 width, height = rows*18, columns*18 window = Tk() window.geometry(str(width)+"x"+str(height)) window.resizable(width=False, height=False) window.confi ...
Currently facing an issue with a Python 3 script. My goal is to add more text to an already existing label in tkinter. This is what I tried: def labelConfig(string,append=False): if append: label.configure(text+=string) else: labe ...
I have this code snippet as the base of my program: from tkinter import * def click(event=None): global text_input user_text = text_input.get("1.0",'end-1c') # what should I do next? window = Tk() text_input = Text(window, height= ...
Trying to install the latest version of Python 3.12.0 on Fedora 38 using pyenv with the command pyenv install 3.12.0 Encountering the following error - ~ pyenv install 3.12.0 Downloading Python-3.12.0.tar.xz... -> https://www.python.org/ftp/pytho ...
I've been having troubles understanding the concepts of threading, queuing, and passing data between two classes. Despite my efforts to search online and get help here, I still can't grasp the necessary information. Essentially, I have a piece o ...
A project I am working on involves developing an F1 Tkinter GUI application. This app allows users to input a driver's name either by typing it out or selecting from a listbox, and then relevant statistics are displayed. My current focus is on handli ...
When working with Python applications that use TK GUIs, it is common to see the following import statements being used: from tkinter import * from tkinter import ttk Now, one might wonder if calling from tkinter import ttk is redundant since ttk should a ...
I'm currently working on developing a calculator application that provides an estimate of annual gas expenses. In order to execute the program, I need to use an algorithm that retrieves input data from spinboxes as integers. However, when attempting to run ...
When running this line: my_font = tk.font.Font(size=20) I encounter the error below: The module tkinter does not have the attribute font Any suggestions on how to resolve this issue? ...
I am facing a challenge while trying to integrate two separate scripts, one with a GUI and the other being a bot script. Individually, both scripts run as expected but when combined, the bot function gets called immediately without displaying the user in ...
Is there a way to change the color of specific parts of a tkinter text widget? Here's a snippet of my code for a chat application where I need to distinguish between the sender and the message: T = Text(window, bg="black", fg="white", font=("bold", 1 ...
Is there a way to change the displayed image when a button is clicked in Tkinter? I have two images and corresponding buttons, but using the configure function does not seem to work. How can I achieve this functionality successfully? Thank you for your h ...
Hey there, I'm currently working on a project that involves using Selenium. My goal is to have my program input the terminal responses (i.e. my print statements). For each page that loads, I print out the name of the page - for example, "forum homepage" or ...
Currently in search of a code snippet that can successfully append a string to the clipboard and retrieve text from the clipboard using Python3 along with tkinter. After some research, I came across an insightful post. I tried out the following code excerp ...
I am attempting to utilize a tkinter button in order to display an ERD diagram using sqlalchemy and PIL. I have successfully achieved this by saving the generated image to a file and then reopening that file to display it in a label. Is there a method to ...
After some reflection, I realized that the progress bar in my code only displays at the end of the completion of the for loop. However, I would like it to show the progress of each cycle step by step. from tkinter import ttk from tkinter import * import ...
I'm a beginner in tkinter and I'm struggling with a simple method. I want to create a submit button that disables if the same user input is submitted again, but carries out its function when new input is provided. Can anyone provide some assistan ...
Is there a way to divide a decimal number into its whole and fractional parts? For example : 1.24345 should be separated into 1 and 24345 1455.24 should be divided into 1455 and 24 1455.0 should result in 1455 as the whole number and 0 as the fractiona ...
I'm attempting to capture a screenshot of a page using selenium and display it on a canvas in my tkinter interface. However, I keep encountering the following error: TypeError: __str__ returned non-string (type bytes) Here is the code snippet. Any assist ...
class AutoGUI: def __init__(self): import tkinter, re, uuid from tkinter.constants import * import tkinter.messagebox import socket, os, subprocess, multiprocessing, sys from getmac import get_mac_address as gma ...
I've been learning Python through a course designed for kids, and one of the projects we worked on was creating a simple paddleball game. I managed to get the ball bouncing off the walls earlier, but now it's not working as expected after complet ...
I am in search of a helpful resource to guide me on how to connect TKinter with JSON. I would like to input a word, search for that word in the JSON file, and then display the result of the search. Currently, I have my python application running smoothly ...
Every time I launch my tkinter program, I find myself having to click on the entry box before I can start typing. Is there a way to configure it so that I can type without the need to click on the entry box? Thanks in advance. ...
I need to create a feature that allows users to generate multiple labels by pressing the "Enter" key: def new_line(event): global Row_n Row_n = Row_n + 1 Choose= tk.Label(frame, text="Choose option", background = "white",fo ...
For my first fully developed Python project, I have created a Pong game using tkinter for most of the functionality. However, I encountered an issue with restarting the program using the restart button without affecting the score counter in the top left ...
Hey everyone, I'm having trouble getting this code in .py to work when compiling it to .exe with PyInstaller, even with the --onefile option. #imports > from tkinter import * from tkinter import ttk import sv_ttk as sv #< imports #definitions ...
I am facing an issue with my GUI where I have a segment that generates multiple labels using a for loop. There is also a button intended to delete all these labels and initiate the for loop again with new data. However, I am struggling to make the button ...
Currently, I am facing a challenge with changing the foreground color of a button on my Mac running Big Sur. I have attempted to resolve this by installing tkmacosx, but it seems there may be an issue with the package. Whenever I run the code below or att ...
I am having trouble linking the button "calculate_button" to the method I created called "calculate()". The method should simply print "you've just clicked", but an error is raised saying there's no attribute 'calculate'. I'm confu ...
What is the best approach for dynamically validating content in a tkinter Entry widget? I have researched using validate=True and validatecommand=command, but it seems that these methods have limitations as they are cleared when the validatecommand modifi ...
Just a few minutes ago, the program below was working perfectly fine. But then I made a small change, ran the code, encountered an error which caused Spyder to crash. Now, it's unable to find Frame or Groove or some other element. Right now, it's ...
I'm facing an issue with getting the correct integer value input from a user in Python tkinter. I've tried using a=n.get() and then converting it to an integer using a=int(a), but it's not working as expected. Below is the code snippet I used: def selectpa ...
Having an issue here where the 'pyplot' element of 'matplotlib' cannot be called. In the given code snippet, I had to include "TkAgg" for the matplotlib element to function properly, as it is a common problem. import matplotlib matplotlib.use("TkAgg") Bu ...
I'm working on an interesting project where I'm developing a secret coding program with a Tkinter GUI to encrypt text, although not highly secure. The main goal of the program is to have a password that is linked to a text file. Initially, I've set the def ...
Is there a way to create a button that performs different actions based on the selection from a dropdown menu? I attempted the following approach but it did not yield the desired results: import tkinter as tk from tkinter import ttk root = tk.Tk() root.g ...
Currently working on a troubleshooting code, I've encountered an issue. When I select "other" and try to input data into the form, upon hitting continue, an error is displayed: Exception in Tkinter callback Traceback (most recent call last): File "C: ...
Suppose you have a main.py file with a line root = tk.Tk() creating the main window of a GUI. In addition, there is another file named menu.py that you wish to utilize to add a menu bar to the root window in main.py. ...
I'm looking to save the selected dates from a calendar to variables. I found this code, but I'm unsure of how to save the date. import tkinter as tk from tkinter import ttk from tkcalendar import Calendar def example1(): def print_sel(): ...
Looking to add a "drop files here" feature to my GUI application built with tkinter in Python. I discovered the TkinterDnD2 library after finding this useful Stack Overflow response. After dropping a file, event.data returns the file name within curly br ...
I am encountering an issue with a button that links to another button in my code. The second button is able to close itself, but the first button cannot both close itself and open a new button simultaneously. How can I resolve this problem? import tkint ...