When attempting to put some maths that change a variable within a definition, I receive an error specifying “Unresolved Reference”. The following is the code I am using, the relevant code on lines 9 – 15. The first “Increment” which is under “FIG 1”: incurs the error “Shadows name ‘Increment’ from outer scope”. The second one (under “FIG 2”) causes
Tag: tkinter
Colors in pillow-generated image viewed in tkinter don’t match colors in saved file
I wrote a Python script that fuses a stereo pair of images into an anaglyph image. When I view the image in a tkinter application I wrote the image looks good but when I save as a JPG and PNG to Photoshop it looks “confused”. For a while I was wondering if I was crazy but I had my family
Tkinter – When adding “row=” to a Label in a for loop, items in list show up over each other
Sorry if the title is confusing I don’t really know how to word it properly. Hopefully the code below will clear it up. When I run the program and I call print_names(), only the last name “Jenny” shows up. While if I call the other two functions, all the items in the corresponding list show up. However unless I add
Use opt/ cmd + Backspace in tkinter
I have a very simple notepad that is made out of the tk.text widget. The only thing lacking is OPT/ CMD + Backspace support on Mac (deleting lines and words). Any way i could add support for it? either through tkinter directly or though a selfmade function? EDIT: I also found out that navigating text using OPT and the arrow
How do i resize this labelframe in tkinter?
So I tried to make this labelframe wider by using the basic width and width option. Here’s my given minimal code. minimalized preview: used in application: i want to get this labelframe little bit bigger and make the inside centered, But i had no knowledge to do so, Any help will apreciated! Answer It seems like you just want to
How to change the layout of a Tkinter Combobox?
To make the border disapear or simply change it’s color. I tried with highlighttickness or borderwidth but it doesn’t work. So I was told to try with the layouts, the thing is I don’t know how to change the border with the layouts On this pic the border is still visible on the combobox I want to delete it or
How to save what a tkinter window looks like without screenshot? (Possibly a numpy array?)
I have a short program that generates images of 1, 2, 3, and 4 random coloured circles to train a neural network on. My issue is, just doing 4000 images takes about 20-30 mins, and I need about 50000 images. My current method is to create the image, screenshot it, and then delete the tkinter object and restart. The issue
Tkinter Events in for loop
I am currently working on an app with tkinter, which is basically PHPMyadmin. After the login I want to display all the databases in Labels and attach an Event to them. Well it kinda worked… Currently this code just prints out all the databases when clicked, but I want it to print just its own name. If it is possible,
Print variable from external file. NameError: name ‘x’ is not defined
I would like to get that: if I select item A in the combobox of main.py, then the variable example is printed as placeholder in phrase (both are located in the external file external.py). So I would like to simply get the phrase of external.py to be printed in the textbox in main.py. The problem is that phrase is in
Why do I need an asterisk and some random variable in these Python Tkinter functions for them to work properly?
In this basic Python Tkinter code, I’m trying to bind certain functions to trigger upon either a UI button press or a keyboard key press. After a while of trial and error, it seems to work the way I want if I add an in the declarations of: and: I get that one asterisk lets the function take an unknown