Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
2 answers
69 views

How do I maintain full file path but only display basename in a sortable python listbox?

I am trying to only display the basename of a file in a python listbox but maintain the full file path somehow. I know how to only display the base file name but the problem is the listbox is sortable ...
Ohtis's user avatar
  • 31
0 votes
2 answers
66 views

Having some trouble subtracting a number value when removed from a listbox via a remove button

I've tried different combinations to try to get values to be subtracted when I order a meal and have successfully gotten the items to be removed from the listbox but have yet to get the items value to ...
Brock's user avatar
  • 1
0 votes
0 answers
36 views

Python // Freezing Tkinter Window

coming from an amateur level of javascript I just started messing around with python and tried to write a small script that checks if a lock file (selected by the user) exists over and over again and ...
Rob's user avatar
  • 1
-2 votes
1 answer
78 views

How do I add Listbox as a panedWindow Tkinter GUI?

Can someone show me how I can add a listbox to panedWindow? Take this code for example: can the left-hand window be made into a listbox? from tkinter import * m1 = PanedWindow() m1.pack(fill=BOTH, ...
NMW81's user avatar
  • 1
1 vote
0 answers
30 views

Tkinter: How to delete items in listbox from a different window Tkinter

I'm still very new to python and this is a practice project of mine I'm creating a task managing app using Tkinter. I'm working with JSON files if it makes any difference. so i have a listbox that is ...
Natalija Prošić's user avatar
-3 votes
1 answer
76 views

How to change an item in a list forever?

I have a program in tkinter which I have a list in it and I transferred the list items to a list box. when I run it, there is a list box and you're able to change the items by pressing buttons and ...
Hooman Mirzaei's user avatar
0 votes
1 answer
41 views

Tkinter: Listbox not populating from function call, populates from list

I have a function that creates a list, and another that's supposed to populate a tkinter listbox with the items from that list. When a radio button is clicked the contents of the listbox should update....
Sabresong's user avatar
0 votes
1 answer
38 views

TypeError: 'StringVar' object is not iterable -- tkinter ListBox()

I'm building a Python version of a popular party game, and I'm using tkinter to build the setup GUI with player name and game preferences.When I run the code the window opens and looks right except ...
Sabresong's user avatar
2 votes
1 answer
55 views

Why does my Listbox print the whole list in one line?

I create a list by appending dictionary entries containing display_name, browse_name and node_id of OPCUA server nodes. When I print the list, all the elements are on one line. I have no idea why. ...
till12mann's user avatar
0 votes
0 answers
69 views

Why does Tkinter lag only the first time a listbox is populated with a large number of lines?

My application, written for Python 3.12.0, loads a large number (around 6,000+ lines) of text lines into a Tkinter Listbox like this: self.listbox.delete(0,tk.END) self.listbox.insert(tk.END,*...
the_endian's user avatar
  • 2,495
0 votes
0 answers
548 views

Python Tkinter Listbox event curselection() trails selection value

I am programming a GUI using a Listbox as a file selection pane. Originally I was using <Double-1> as my event trigger, but decided to switch to <Button-1>. Long story short, I find there ...
Tom Smith's user avatar
0 votes
0 answers
91 views

TKinter : filter a dataframe by listbox objects

I'm trying to create a small application to directly download data according to several criteria via TKINTER. I'm having trouble with one element in particular, namely the "Listbox" widget. ...
Ezaan's user avatar
  • 1
0 votes
1 answer
239 views

How to display a messagebox once all the items in the Tkinter listbox is selected?

Ive coded a gui call script with each line being an item in the listbox. I want a messagebox to tell the user that all the items in the listbox are completed. please assist if possible. list = Listbox(...
Mogamad Zubair Isaacs's user avatar
0 votes
1 answer
101 views

How can I use the scrollbar to scroll vertically through the buttons in the list?

I need the buttons in the types list to scroll vertically using the scrollbar, but something is wrong with my code below. This is because the scrollbar works but the buttons in the list do not scroll ...
suniu's user avatar
  • 3
1 vote
1 answer
559 views

How to create a selectable "list" of images via Tkinter in Python

Say there is a folder with a bunch of pictures. When a user opens the window the program should load all of the images in that are in the folder and display them in a kind of a selectable "...
Michael_G's user avatar
1 vote
1 answer
173 views

Python Tkinter Listbox.delete(0, END) does not seem to work inside a class

I was creating a GUI class which inherited tk.TK to make a tk app and while using Listbox inside a seperate Frame, I ran into this problem where Listbox.delete(0, END) does not work inside the class. ...
Mythical Phantom's user avatar
0 votes
1 answer
26 views

TKinter: Listbox population misunderstanding. Help appreciated

I am developing a very crude window to broaden my understanding of certain TKinter widgets like comboboxes and scales. The current widget I am working on is a simple Listbox featuring a list of pages ...
Creo-Dasher's user avatar
-2 votes
1 answer
80 views

How to update .txt file list after deleting an item in list box

I'm new to Python and TKinter. I can't figure out how to code this one. Let's say my .txt file consists of 3 names: ["Bob", "Mark", "John"] After deleting "Mark"...
Kris R.'s user avatar
1 vote
1 answer
107 views

Python Tkinter Listbox - How to determine if an item was actually selected during mouse event

How to find out if an item was actually selected in a tkinter listbox and not just the nearest item? import tkinter as tk def my_function(item): x = listbox.get(item) print(f'You chose: {x}') ...
David Saylor's user avatar
1 vote
0 answers
31 views

tkinter Listbox unchecks and calls binded function entries when tab pressed [duplicate]

So I am trying to create multiple listboxes in one window with python tkinter. I defined the listBoxes like: def create_list_box(self, text, row_nr): tk.Label(self.inner_frame, text=text).grid(...
Michiel's user avatar
  • 100
0 votes
3 answers
159 views

tkinter listbox mixer plays one song at a time

I can't figure out how to get a tkinter list box to play continuous audio files in my Music Player without using classes, which I don't fully understand yet since I am new to python. I already created ...
andypappy's user avatar
-1 votes
1 answer
77 views

Python Tkinter listbox color individual word

From this answer I know how to color individual items in a listbox. However, is it possible to color individual words/characters inside the item of a Tkinter listbox? If yes, how to achieve that? If ...
Programer Beginner's user avatar
0 votes
2 answers
95 views

How can I use a button widget to grab an item from a listbox?

When I press the "Take" button, it should grab the item from the Listbox and put that item into the "You are carrying" list as well as update the room and the Listbox. I was ...
Bella B's user avatar
0 votes
1 answer
37 views

how to clear listbox of previous selected radio button from the window after selecting another radio button using tkinker

I am an absolute beginner in programming and to Python. I am trying to create a gui using tkinter. In this program, I want click any radio button and see the list of software name. Here is the code: ...
ijahan's user avatar
  • 93
0 votes
0 answers
25 views

After binding my mouse click to options in tkinter, I want to be able to use the options selected to write an if statement

I want to use the listbox function to do a calculation if one of the options is selected. I tried returning the function and storing it in a variable but it did not work. def miler(): bolt = float(...
Boadu Lawrence's user avatar
1 vote
1 answer
635 views

How to add auto-hide scrollbars with python tkinter in a listbox

how can i add auto-hide scrollbars with python tkinter in a listbox? for example, to hide the scrollbar when the size of the listbox is less than or equal to the size of the frame, and otherwise ...
Mike's user avatar
  • 43
0 votes
1 answer
152 views

How do you get all the contents from a tkinter "multiple select" Listbox?

You can see here that I am creating a tkinter ListBox and populating it with 3 items. All I need to do is be able to record what the user has selected when they press the button! I know that when you ...
bluesquare's user avatar
0 votes
0 answers
116 views

Changing and saving background colors of listbox item

def change_color(): colors = askcolor(title="Tkinter Color Chooser") index = listbox.curselection() if not index: return new = listbox.get(index) listbox.delete(...
Ahpatot's user avatar
0 votes
1 answer
83 views

Tkinter listbox selecting empty elements

# creating the 2 listboxes possible = customtkinter.CTkLabel(master=root, text="Possible Reagents", font=font2, width=110) possible.place(x=400, y=8) possibleListbox = tkinter.Listbox(root, ...
Gummi's user avatar
  • 1
0 votes
2 answers
113 views

Tkinter weird listbox behavior

def possibleClicked(stuff): selectedItem = listbox.get(listbox.curselection()) print(selectedItem) listbox.delete(listbox.curselection()) listbox2.insert(tkinter.END, selectedItem) ...
Gummi's user avatar
  • 1
0 votes
0 answers
42 views

How to open a URL from a Listbox in Tkinter TTK

I am trying to open URLs based on choices from a set of list boxes. I have the listboxes showing the options successfully. But when I try and double-click the URL to open the browser, I get a ...
NaterVater none's user avatar
0 votes
0 answers
35 views

Select an item in a listbox and modify that same item - python tkinter

So I am studying for my tkinter exam and I am having this problem where I have this Listbox (lbtarefas), and I have this button (btn_adicionar), and whenever I write something on this textvariable (...
user avatar
0 votes
1 answer
533 views

Tkinter Listbox.get(ANCHOR) not grabbing correct item when arrow keys are used to scroll

Consider the below piece of Python code from tkinter import * root = Tk() root.title("Listbox Test") root.geometry("200x300") def ShowSelected(): ShowText.config(text = Box....
Theodore Brown's user avatar
0 votes
0 answers
77 views

Python Same Row Selection in Multiple List Boxes

My problem is i can not select all same row datas in multiple listboxes in python-tkinter. Currently I have 5 different list boxes .I am using Python and tkinter.Also i am using one Excel workbook ...
Coder OF Pyhton's user avatar
0 votes
2 answers
1k views

select_set() method of Listbox tkinter widget in Python enables multiple selections even selectionmode is set to BROWSE

I am working with Python 3.10.5 64bit and a strange behavior regarding the listboy widget of the tkinter modul. Look at the following code: import tkinter as tk root = tk.Tk() cities = ['New York', '...
Klaus Sobel's user avatar
1 vote
1 answer
52 views

Quiz listbox items displaying in one line

I am trying to show the options for quiz questions in a listbox. The value will later be retrieved with a button. They show as one line instead of different listed items. I think it has something to ...
Ed_Analyst's user avatar
0 votes
0 answers
40 views

Use 2 files from 2 different folders stored in a listbox tkinter

I have a code which I am trying to open different files from different folders and use those files to plot a graph. I am using askdirectory in tkinter and storing the filenames into a listbox. ` ...
nicoleW's user avatar
0 votes
0 answers
45 views

How to trace the listbox size in tkinter on every insert?

I am not able to trace out the size of the list box on every insert to Listbox in Tkinter, python Actually, I am taking data for the communication port on a while loop and adding the text output to ...
Naveen Sharma's user avatar
0 votes
1 answer
52 views

Button will not change to active when listbox is selected?

I've made a function that creates a toplevel window with buttons and a listbox. I have an edit button to edit a selected item in said listbox, but I want this button disabled if nothing inside the ...
Go Sonic's user avatar
-1 votes
1 answer
220 views

How can I delete an option from a listbox and having that reflect in a text file?

I have a listbox of saved values that are also saved into a .txt file. I can delete options in the listbox just fine, but I am having a hard time finding out how to reflect the deleted values in its ....
Go Sonic's user avatar
0 votes
1 answer
172 views

tkinter, python: Button not showing up after Listbox, and Listbox not responding at all

I'm a tkinter newb, making slow progress. This question is about my parse_html func but I included relevant main code too. I can't figure out why the OK button isn't even showing up after the Listbox. ...
Meghan M.'s user avatar
  • 309
0 votes
1 answer
99 views

_tkinter.TclError: bad listbox index "" unwelcome <Listboxselect> event by selecting text in a Entry Widget

I have a Listbox and a Entry Widget. If i have selected an item in the Listbox per Bind and now click in the Entry Widget and try to invert a text input, there comes a ListboxSelect Event. How can i ...
WStark's user avatar
  • 1
0 votes
0 answers
206 views

getting line number of selected item in tkinter.ListBox

I am creating a simple listbox. While assigning values, I put custom index numbers 1, 5, 6. but when I try to get index of list it return automatic index number i.e. 0, 1, 2 rather than 1, 5, 6. i don'...
Hamid Shah's user avatar
0 votes
1 answer
85 views

Tkinter with Object Oriented

I'm new with Tkinter module and i tried to use OOP with Tkinter. Mycode has no error but the Listbox widget has no output , here is my code : from tkinter import * class Test: word = "" ...
user avatar
1 vote
2 answers
689 views

Why am I not getting the selected value from the tkinter listbox?

`from tkinter import * pencere = Tk() başlık = pencere.title("deneme2") etiket = Label(text="") etiket.pack() def göster(event): etiket["text"] = "%s seçildi.&...
NEHİR ERGAN's user avatar
-1 votes
1 answer
57 views

Button not showing up while opening new page (python tkinter)

I want to use the listbox in tkinter in order to open a new window with a button, but when I'm pressing a message it only opens the window, without the button. from tkinter import * from playsound ...
user avatar
1 vote
1 answer
146 views

displaying picture by clicking an item from the listbox items

does anyone know or have any idea how can I display the picture by selecting an item from the listbox and displaying it to the frame_3? here is the whole code for the reference and the picture ...
Jay Delos Santos's user avatar
0 votes
1 answer
235 views

displaying image in Tkinter whenever clicking an item from the listbox

This is my whole code for reference and I would like to know how I can display their own respective country pictures whenever I click a country on the listbox to the frame three because I do not know ...
Jay Delos Santos's user avatar
0 votes
0 answers
206 views

Tkinter | Listbox | I can't get curselection to work

THIS PROBLEM IS RESOLVED!!! Hi! I'm kinda confused – Because of fun, I've decided to make a quick and dirty program to make my life a bit easier. Turns out that I'm apparently not that good with ...
atefxf.'s user avatar
  • 11
0 votes
1 answer
234 views

Unable to retrieve value from tkinter Listbox after closing the main window

I have designed a Tkinter listbox which looks like this: When I am in the main loop I can select the options 'A', 'B', etc and print it in the console. When I click proceed the window closes. Below ...
NEEK's user avatar
  • 11

1
2 3 4 5
10