Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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
1answer
16 views

python sqlite inserting error

I am using python 3 tkinter and sqlite I have data inside tkinter Text Widget and then i need to split and save it in a data base table here is my code attempts data = txtReceipt.get("4.0" ,"end")...
-1
votes
0answers
9 views

Python Multiprocess calls a subprocess that reads from another subprocess, still blocking with demonize set to True [duplicate]

I have a video transmitting app written in python, and I have been struggling to make the "Transmit" button, non-blocking. After the tranmission starts, the transmit button is supposed to disable, ...
0
votes
1answer
17 views

i want to give my app to some one but it does not work on his computer python pyinstaller

I have build a store management system and had compiled it with pyinstaller like "pyinstaler -F admin1.py". it has given me a build file and a dist file when i run the app on my computer it runs ...
1
vote
1answer
27 views

How to automate parse.unquote(), .clipboard_append() etc. in Python - tkinter

I'm trying to make a link slicer that automatically slice and copy the sliced output of the link right after I pasted it on txt = Entry(window,width=50) without clicking a button. When I paste a link ...
0
votes
0answers
16 views

Reading serial input and printing to Tkinter GUI

I'm trying to make a Tkinter based GUI for an Arduino printing sensors value and responding to user input. The code I'm trying to use to eliminate while loops is this, which doesn't print any sensor ...
0
votes
0answers
14 views

How to take input from Tkinter and insert into code in a specific place?

With the help of a friend, I've made a program that looks at a directory of files, and then scrapes data from said files. Currently, the Python script has to be edited manually with the directory to ...
-1
votes
1answer
11 views

how to fetch all the details and show in Tkinter GUI by using roll number menttion in two tables in the database?

I am new to tkinter , I am searching a way so that i can easily show my two tables Student and Issue Book table in database using roll number which is common in both ( and it is a primary key ) to the ...
0
votes
2answers
403 views

openpyxl KeyError Worksheet {0} does not exist

I know you probably have seen this title, but please dont mark as duplicate as my error is different. I am making an excel comparing program with openpyxl and using tkinter to make the UI more ...
0
votes
1answer
27 views

Clear a Text Box within tkinter

I am trying to refresh a label in a tkinter GUI and its proving very difficult. I have tried the destroy() command and delete command e.g def Erase(): self.e1.delete(first=0,last=100) I have ...
0
votes
1answer
9 views

scrolled text python change ceratin background text

i am trying to program text editor by using tkinter. this is the mark function: self.text.tag_add("Mark",tk.SEL_FIRST,tk.SEL_LAST) self.text.tag_config("Mark",background="yellow",foreground="black") ...
7
votes
4answers
12k views

Show webcam sequence TkInter

I did a program with python, importing the OpenCV's libraries. Now, I'm doing the GUI in Tkinter. I'm trying to show the webcam in the GUI but I couldn't. I put the code in the Function because I ...
0
votes
0answers
14 views

tkinter entry textvariable not displaying in Python 3

There have been similar questions asked, but none reflect the behavior I am seeing. I have a GUI that was working perfectly in Python 2.7. I recently updated to 3.5.2, and altered my tkinter imports ...
0
votes
1answer
24 views

How to get output of terminal commands to python gui text area using subprocess?

import subprocess subprocess.call('gcc a.c', shell=True) subprocess.call('./a.out', shell=True) I am executing this statement to compile a ".c" file. I got the output in the backend. But how ...
1
vote
1answer
19 views

Editable Combobox in Python

How can I set the List as the values for the Combobox numberChosen? After this, I want to edit the List with my entries. Do I need a loop for this? It would be great if somebody would help me, thank ...
0
votes
1answer
27 views

Using grid how do I not have frames push each other out of place

Been working on this problem for more than a day. I would like for my top frames to be right up against the picture. When I don't include section 2 frames below the northern frame it works out ...
1
vote
1answer
27 views

PYTHON 3.7 _tkinter.TclError: invalid command name “tixBalloon”

Hello I am trying to create a button that will show description when hovered. similar to html img tag "alt" I decide to use "tkinter.pix" with Balloon() But I am having an error: _tkinter.TclError: ...
0
votes
0answers
12 views

Tkinter grid propagate and scrollbar

I have a text widget I want to set at a specific size in pixels. To do this I have put it and a scrollbar in a frame with grid_propate set to False as follows: with open (file_name) as f: c = f.read (...
-1
votes
0answers
15 views

Update barcode image in tkinter based on live sensor data [duplicate]

I'm trying to create a python script that reads sensor input from three ultrasonic sensors, creates a barcode image from the combined distances read from the sensors, and then displays the values and ...
0
votes
0answers
18 views

Python tkinter : Add a vertical and horizontal scrollbar in the listbox

I have this render_gui function in Python. def render_gui(): global root global prev_key global listbox, label1, entry1 prev_key = 0 root = tk.Tk() root.title('Server Chat ...
0
votes
2answers
23 views

how do you restrict the length of a tkinter text widget in python by blocking the latest character entered?

I am trying to limit the amount of characters in a tkinter text widget or entry widget (either widget type is fine) in Python in a very specific way. I have a solution with a text widget that is ...
0
votes
0answers
15 views

Openpyxl: Appending all cell values in each row, then insert into tkinter listbox

I'm a beginner in python and stackoverflow. I have imported openpyxl and tkinter to make this: def cell_range(): global combinedCells try: startRange = startingCell.get() endRange = ...
1
vote
2answers
712 views

Autocheck children items in Tix with Python using CheckList and Hlist

I am writing a small program in Python using Tix that builds and displays a tree view of certain folders (only the ones having a certain xml file in them) with checkbox capabilities. Every Item is a ...
5
votes
3answers
2k views

Why is Photoimage put slow?

When manipulating photoimage objects, with: import tkinter as tk img = tk.PhotoImage(file="myFile.gif") for x in range(0,1000): for y in range(0,1000): img.put("{red}", (x, y)) the put ...
-2
votes
0answers
35 views

Why can't I print the contents of this database table?

Can anyone help me with my problem please? I am trying, in this code example, to collect the information that the user types into the text box. When the user presses the submit button it will create a ...
1
vote
1answer
22 views

tkinter treeview row display value discrepancy with underscore

I have a treeview display of invoice related data. The invoice identifiers have underscores. I have noticed the underscore displays correctly in the GUI however the invoice number value obtained from ...
-7
votes
1answer
110 views

Divide by zero error input into Tkinter message for a calculator

I built a calculator in python and it works, except that if someone tries to a number divided by zero, they don't receive an "Invalid Syntax!" error in the calculator input. How could I make it so the ...
0
votes
1answer
15 views

Getting a Permission Denied Error When Trying to Copy Files

I am trying to copy a file from entry box 1 to the location of entry box 2. I am getting an error: File "File_Name\Shutil.py", line 121, in copyfile with open (dst, 'wb') as fdst: PermissionError: [...
-1
votes
0answers
33 views

How to clear matplotlib data? plt.clf(), pat.cla(), plt.clear('all') none seem to work

I have a desktop based mac application which is built using TkInter. The app calculates optimized triangulation given a polygon. There are three optimization techniques which a user can indicate. The ...
0
votes
1answer
17 views

Text Widget not clearing with delete function

I'm creating a tkinter gui app and one of my frames has a text widget that calls a function and prints its output onto the widget. Right now i have a button called "activeAlarmButton" that prints ...
2
votes
1answer
17 views

White line through optionmenu

I get a weird line through my optionmenu and I have no idea why. Any tips? Just test code, but I have no idea where that line comes from. I've tried changing the size of the menu to fix it and tried ...
0
votes
1answer
18 views

ImportError: No module named '_tkinter'?

My imports : from pydub import AudioSegment import matplotlib.pyplot as plt import numpy as np import wave import sys why am i getting that error while i'm clearly not importing tkinter and how to ...
0
votes
0answers
20 views

Tkinter Entry + Python + Sqlite with params

I am having a lot of problems to understand how to create a tkinter-gui for an sqlite query. Idea: I have one table with 1.7m+ rows. My queries are divided in three areas: I. queries with 5 ...
0
votes
0answers
12 views

displaying a mapbox static map in a tkinter canvas

the goal: what i want to achieve at the end is : a code that uses Static from mapbox lib in order to get a static map (basically an image of a map) using .image(....) then display it in a tkinter ...
0
votes
1answer
23 views

How to bind event to Menu choice with Tkinter?

I mean, so that when I click on a choice, it happens something (example, if I want to insert a grade as input after clicking on a choiche with the name of the subject written on it). How can I do it?
1
vote
2answers
17 views

Python: Tkinter TclError: can't invoke “image” command

preface: I have currently tried most things and there are few qusestions asked on stackoverflow on this question and i cant seem to wrap my head around it so im going to need some help application: ...
5
votes
3answers
3k views

Change width of dropdown listbox of a ttk combobox

I am trying to change to width of the popdown list of the ttk Combobox. Setting the width of the Combobox also changes the width of the Listbox, making part of the values unreadable. I read this ...
1
vote
1answer
18 views

Close cmd while Tk object remains

So I made a simple calculator in Python 3.7 and made a batch file to get it to run from the CMD. The thing is, after I run the batch file, I get a CMD window and then the Tk window, but the CMD window ...
-1
votes
0answers
7 views

python tkinter access value from main menu list created dynamically [duplicate]

portmenu= Menu(menubar, tearoff= 0) for p in ports: portmenu.add_command(label=p, command=lambda: g0.disp(p)) This displays the last value in the ports[]. I need to get the selected value in the ...
0
votes
0answers
8 views

How can I create a counter that displays your score at the end of a quiz in tkinter?

I want to use the variable correct, and add one to it if the user answers correctly, and then display at the end how many answers they got correct. As of yet it doesnt display the score at all on the ...
0
votes
0answers
26 views

no figure appearing using plt.show() even with interactive backend

I'm trying to learn how to plot using python and it has been a frustrating journey so far. I just run the simple code below: >>> import matplotlib.pyplot as plt >>> plt.plot([1,2,3])...
1
vote
0answers
12 views

RHEL7 import tkinter failed inside virtualenv

On Redhat 7 and python3.6 I can import tkinter without any error: Python 3.6.5 (default, Jul 25 2018, 21:22:33) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux Type "help", "copyright", "credits" ...
0
votes
1answer
194 views

How can I use Tkinter in a virtual environment?

I want to use Tkinter in a virtual environment, but I have a problem: Tkinter is not included with the virtual environment. On this site, I found a solution: adding the environment variable to the \...
1
vote
1answer
27 views

Tkinter treeview widgets not properly aligned/added space between widgets

I am working on this table in tkinter made from a bunch of treeveiw widgets. The idea is to get a table where I can add lines, select lines and edit them. In the code below you can add lines to the ...
-1
votes
1answer
25 views

Tkinter scrolling (scrollbar on frames)

I am still new to this and I need some help in inserting a scrollbar to scroll the circled area just in case the list gets long in future. Thanks in advance. The image is included here.(the circled ...
-2
votes
1answer
19 views

Issue with button python tkinter [duplicate]

from tkinter import * from tkinter import ttk from random import * root=Tk() root.title('battleship') #create 2 separate frames########### ###create a dictionary that collects all the buttons under ...
-1
votes
1answer
11 views

Images in Tkinter [duplicate]

How come I can't add images using this: from tkinter import * root = Tk() def logo(): photo = PhotoImage(file="Logo.png") Label(root, image=photo).grid() logo() root.mainloop() But I can ...
-1
votes
0answers
23 views

Display multiple charts on a frame using Tkinter

Using the following code I am able to create a random number of pie charts. The number of pie charts that are generated is not known before the execution of the code. I want somehow to create a frame/...
0
votes
1answer
24 views

Make NESTED tkinter frame widgets look like one frame

Is there a simple way to get nested frames to look like one frame - preferably using the grid layout manager? This is relatively easy to do when the frames are not nested (i.e. the frames are ...
-1
votes
1answer
19 views

Plotting incoming TCP data in real-time (filtering out strings?)

I'm trying to plot pairs of data values coming in from an instrument over TCP. I can successfully receive these values and print them to my UI, but I can't seem to figure out how to plot these values ...
1
vote
4answers
1k views

Use asyncio and Tkinter together without freezing the GUI

I want to use asyncio in combination with a tkinter GUI. I am new to asyncio and my understanding of it is not very detailed. The example here starts 10 task when clicking on the first button. The ...