close
Skip to main content

New answers tagged

Score of 0

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

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
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

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

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

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

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

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

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

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
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