New answers tagged tkinter
Score of 0
0
votes
Getting folder path with Python Tkinter tkFileDialog
I have created this class, which is going into a wider tkinter project. Class opens a standard dialog box, returns the directory path and the directory name.
from tkinter import filedialog
import os
...
Score of 0
0
votes
How to stop Tkinter ScrolledText widget resize on font change?
You can just make a tag with all the selected text:
text.tag_add('all_text', '1.0', 'end')
... and then you can change the font of all_text:
text.tag_config('all_text', font=(24))
This is very ...
Score of 3
3
votes
Accepted
Tkinter custom selectable/deselectable object using ttk.Label
Couple of issues in your code:
You're calling select instead of passing it.
self.bind('<ButtonPress-1>', self.select())
Those parentheses run select() during construction and then binds the ...
Score of 0
0
votes
Importance of python module constants
It can be useful to use constants, because then you don't have to type quotation marks. You can import them all with:
from tkinter import constants
Here is a list of all constants:
# Symbolic ...
Score of -1
-1
votes
How to show a pygame window with a tkinter window?
Note that root.mainloop() will only return when the main window is closed. Therefore the pygame loop will not be executed until the main tkinter window is closed.
To overcome the issue, you can ...
Score of 6
6
votes
How to show a pygame window with a tkinter window?
Python's tkinter is primarily designed to be the sole orchestrator of a running program. Pygame, inviting more custom interactions by default, will need you to write your code to interact with other ...
Score of 0
0
votes
exe from a most simple tkinter python script not working
The PyInstaller command you are using it wrong. Since this is a Tkinter(GUI) program,it has nothing to do with the console. What you see is the console. So give the --windowed flag:
pyinstaller --...
Score of -1
-1
votes
How to retrieve a variable from another threading.Thread?
OK, the first answer was a joke.
But here is probably a better answer to help you without 200 lines of code:
You probably do not need a thread for this.
There are two separate problems in the original ...
Score of 1
1
vote
How do I pass class variables to functions imported from another module?
Problem solved. The issue was that in my main application, I used reduce from functools, and Sheet from tksheet. I had to include these import statements in my func_module.py file. I am not sure why ...
Score of 2
2
votes
How to retrieve a variable from another threading.Thread?
Variable data_load is created in thread when it runs data_load = ...
If thread is slow then python may try to run Label(..., text=data_load) before thread creates this variable.
Simple method for this ...
Score of 3
3
votes
Accepted
Is it possible to retrieve TKVars associated with a given Widget?
You may need to use w.tk.call('info', 'vars', '*') or w.tk.call('info', 'globals', '*') or w.tk.call('info', 'locals', '*') (see documentation here).
import tkinter
w = tkinter.Tk()
sv = tkinter....
Top 50 recent answers are included
Related Tags
tkinter × 52639python × 45799
python-3.x × 10997
user-interface × 4605
python-2.7 × 2147
tkinter-canvas × 1947
button × 1547
tkinter-entry × 1355
matplotlib × 1261
tk-toolkit × 1159
canvas × 1090
ttk × 1073
multithreading × 909
class × 857
image × 775
python-imaging-library × 773
widget × 752
treeview × 709
function × 708
label × 701
sqlite × 605
scrollbar × 582
listbox × 562
macos × 499
oop × 495