Tagged Questions
0
votes
0answers
4 views
Python, Tkinter, Function to destroy Images. (multiple arguments)
ive been making a program in Tkinter and basically i want to remove all the images that have been placed on the window to be removed. Seen as the function i have created (or tried to :P) is in charge ...
0
votes
1answer
9 views
Tkinter askopendialog runtime error after dialog confirmation
Consider the following code snippet:
from tkinter import *
import tkinter.filedialog as fd
def mycallback(event):
fname = fd.askopenfilename()
print(fname)
root = Tk()
b1 = Button(root, ...
-2
votes
0answers
21 views
How to move graphical objects in Python
I'm a relative newbie to Python. I want to move an application I wrote in JavaFX to Python. Basically, I want to have many simple objects, let's call them "Clients", that consist of a circle, a text ...
3
votes
2answers
30 views
Centering window python tkinter
Ive recently started using tkinter in python, and I was having trouble centering the window. I tried all the tips on this website, but whenever I try them, the window is like a line in the middle of ...
1
vote
1answer
30 views
Python - sending constant serial data from scale widget
Hi new to this forum and programming in general. i have a project that requires the value from a tkinter scale to be sent over the serial port every second. I have been pulling my hair out trying to ...
0
votes
2answers
21 views
Trying to make a label update in tkinter from a random variable
I'm trying to make a virtual dice within Python and using tkinter for the GUI, basically generating a random number form 1-6 but i cannot get the label to update with the result of the 'roll'. Can ...
1
vote
3answers
27 views
import a tkinter widget in wxpython application as a panel
I created a analog rpm gauge using the canvas widget of Tkinter and I want to import it in a wx GUI application (as a panel, maybe). Is there any way to do it or I must rewrite this widget in wx?
1
vote
1answer
45 views
Image in Tkinter Label?
I am new to python GUI programming, I want to add a image in my tkinter label, I have created the following code but the window is not showing my image. Path of image is the same folder as this code. ...
0
votes
0answers
27 views
How to expand window/frame when button or checkbox is clicked in tkinter?
I am using Tkinter for my python script. At current stage, gui looks ugly because of too many options/widgets in one screen. Not all of them are needed all the time and it can be divided into four ...
0
votes
1answer
18 views
How to set to see end of text in Tkinter Entry widget?
I am a newbie to tkinter in python and making a gui interface to make my script available to general user. My question is - I have a entry widget which takes 'file path' as value when user picks a ...
0
votes
1answer
19 views
Import liraries cause tkinter gui to stop working
I'm currently trying to write a simple GUI to help using a library written in python 2.7 I've been working on recently. I've started using Tkinter and I'm playing around with the basic widgets to get ...
0
votes
1answer
24 views
My compound text does not refresh over my Tkinter image
This is my first time using Tkinter and Python. I want to run a series of 4 images in a loop. The user interacts with the interface by clicking each image. My 4th image has a compound text which ...
0
votes
0answers
23 views
Using Python Tkinter: How to smoothly move and resize the non focusable window?
I created a non focusable window using Tkinter:
import Tkinter as tk
import win32api
import win32con
import pywintypes
root = tk.Tk()
root.geometry("+0+0")
root.lift()
hWindow = ...
0
votes
1answer
23 views
Pillow, Tkinter, Python, Invisible image button
Good evening all :)
So, ive been working on a little project of mine and ive come up with this code (with a little help from Sapphire64 :) )
I can display an image as a button to make it clickable ...
0
votes
1answer
26 views
Testing issue with Tkinter event
I'm writing unit tests for a tkinter widget that is part of a larger application.
I have some issue related to event triggering on labels in order to assert callback execution.
Please note that my ...
0
votes
1answer
25 views
Python Pillow Tkinter, destroy image,
So ive been tinkering with Tkinter and Pillow for a project of mine and have so far come up with a clickable image. When i click the image it prints image has been clicked. However i want the image to ...
0
votes
2answers
39 views
Multiple tkinter forms?
I have a GUI which I created using python and the tkinter module
My code looks something like
from Tkinter import *
from PIL import Image, ImageTk
master = Tk()
def f1():
print "Change to form ...
1
vote
1answer
28 views
How to add image component to tkinter GUI?
I have a relatively simple python script utilizing a tkinter GUI
the code looks something like
from Tkinter import *
master = Tk()
def f1():
print "function f1 does stuff, nice.."
title = ...
2
votes
0answers
23 views
Python ttk.combobox force post/open
I am trying to extend the ttk combobox class to allow autosuggestion. the code I have far works well, but I would like to get it to show the dropdown once some text has been entered without removing ...
-1
votes
0answers
26 views
Capturing selections from two listboxes in Tkinter
I know I can bind with <<ListboxSelect>> on a listbox. What if I have two listboxes and I want to get one index from the first listbox, second index from the second listbox?
Ideally I ...
0
votes
2answers
23 views
Set Inputfield to have a transparent background
I've got a problem.
I want to realize an Inputfield ( Text() ) in front of an image ( ImageTk.Photoimage() )
But the white background of the Inputfield covers the image. So my Question is, how can i ...
-1
votes
1answer
30 views
Tkinter - Frame Scrolling into Another Frame?
I'm having an issue where I have two frames on a grid; one is on top, and one is on bottom. Both have a canvas in the frame. In the bottom canvas, I have a scrollbar. The only issue is that when I ...
0
votes
0answers
15 views
Tkinter ttk.Notebook border color or width
I've got a Notebook widget using the clam theme. It has a thin white border all around it (which goes up and around the tabs themselves, as well as the sides of the screen and the bottom), which is ...
1
vote
1answer
35 views
cannot concatenate 'str' and 'instance' objects
i'm coding a program, that, if you put a text in a textbox it search the content on Google.com, but it returns an error:
TypeError: cannot concatenate 'str' and 'instance' objects
This is the code:
...
-4
votes
2answers
40 views
Binding Enter key to run a function in Tkinter [closed]
I just wanted to run prime() by hitting Enter. I am running this in Pycharm, Mac OS X.
__author__ = 'student'
from Tkinter import *
def clear(): #opens clear button operation
...
0
votes
4answers
27 views
Argument won't pass
I am making a basic GUI app using tkinter that gathers user input to populate a docx template.
There is too much code so I'll just post where I think the problem is. Here's my button.
self.my_button ...
0
votes
1answer
22 views
Tkinter: How to dynamically insert items to another listbox?
Newbie here. I am struggling with Tkinter a bit. I have much more complex program but I created this little script to show you what I'm trying to achieve. I have two listboxes, first one contains some ...
-1
votes
1answer
14 views
Tkinter Entry Box 2 is receiving entry box 1 's characters whiles i type in entrybox 1
When I type in entrybox1 it automatically appears in entrybox2. So is like anything that happens entrybox1 happens to entrybox2.
Below is my code
from Tkinter import*
import random
class Love:
...
1
vote
0answers
26 views
Python Tkinter Error (Weather API)
I have this program which uses a Weather API and gets the weather of a city.
The city is read from a text file.
Here's the Python File:
import urllib2
import json
from string import capitalize
...
0
votes
1answer
19 views
Python Tkinter, Number of Label/Entry based on IntVar
I was hoping someone could help me with something. I would like to make an Tkinter app that asks for a number then uses that number to draw the correct number of Labels and Entrys.
Here's basic ...
0
votes
1answer
24 views
creating a self-report questionnaire with tkinter radiobuttons
I would like to create a self-report questionnaire using tkinter. This questionnaire has a number of questions, and for every question the user should respond using numerical values ranging from 0 to ...
0
votes
0answers
16 views
Python “non-empty format string passed to object.__format__” when insert string to tkinter Text widget [duplicate]
I'm getting some data from database and when I try to print query result to tkinter Text Widget it shows error:
...
0
votes
1answer
49 views
Python 3.x turtles extremely slow?
I've found that python's turtle implementation is amazingly slow. I expected some delay but not entire minutes of waiting around for a relatively simple fractal (Koch curve with 5 iterations).
Even ...
-1
votes
2answers
29 views
Change tkinter widget position
I have code similar to the following
import tkinter as tk
from tkinter import Tk
from tkinter import ttk
root = Tk()
ttk.Label(root, text = 'label text', justify = 'center').grid(row=0, column=0)
...
0
votes
1answer
27 views
Let to button a text of a textbox
I'm trying to create a webbrowser, but i've problem with tkinter, this is the code but it give me an error:
File "C:\Users\Fulvio\Desktop\OpenBrowser.py", line 10, in callback
...
0
votes
1answer
22 views
Print output onto the GUI [duplicate]
I have this code and I want the output to be printed onto the GUI instead of in the python shell. The code looks like this:
from tkinter import *
root = Tk()
mainframe = Frame(root)
mainframe.grid()
...
0
votes
1answer
17 views
how to a get text from python Tkinter entry after window has closed?
I have a script where I want it to popup a dialog to the user. Once the user enters text the window will close and the script can take the entered text an move on.
I am having trouble getting the ...
0
votes
0answers
36 views
How to draw smooth arcs in Python without supersampling? [closed]
My goal is to replicate this procedurally generated fantasy handwriting library using Python, for the purpose of building up my Python skills. It uses arcs of varying lengths, widths and directions to ...
0
votes
1answer
32 views
Tkinter Text widget organizing inserted text
I got a problem with text inserted into Tkinter Text Widget. After inserting text does not looks legibly(its statistic data from PostgreSQL).
public AO_21D670_WHITELIST_RULES 5 |1 ...
1
vote
1answer
56 views
Sample Python Timer program
I'm trying to do a timer function in Tkinter python, in which I want to call one method consecutively in timer events.
My program is plain sub class, it doesn't contain root or master since I kept ...
1
vote
1answer
24 views
Modify Default Ttk Clam Widget Colors
I'd like to be able to change the style options of one of the default ttk styles (clam).
Whats the best way to make this menubutton match the default white of the entries around it?
-4
votes
0answers
27 views
TypeError: the _handle attribute of the second argument must be an integer
I'm getting the error TypeError: the _handle attribute of the second argument must be an integer whenever I uses the Tkinter or shputil . I'm unable to solve it.
from tkinter import *
class App():
...
0
votes
1answer
20 views
Why do random spawning labels speed up another moving label?
I am making a cat and mouse type game (just for fun and to learn about bind etc.), one label is controlled by the arrow keys, the other one follows it, chasing it a bit slower. I decided to add a ...
0
votes
0answers
16 views
Cairo with tkinter?
Is it possible to draw on a Cairo Surface and then display that as a tkinter.PhotoImage? Could somebody provide an example or at least a description of how one would do this?
1
vote
1answer
24 views
tkinter Menu styling on Linux
On Linux I want to change the Menu background color and make the relief flat. I've figured out how to do this but when the mouse hovers over the menu, the old background color with embossed relief ...
1
vote
3answers
33 views
Controlling Order of Callbacks with Tkinter
Short version: Is there a way to control the order in which callbacks associated with different widgets are handled in Tkinter?
Longer version: I have been using the following program in IDLE while ...
0
votes
2answers
18 views
Expanding with multiple frames in tkinter
I am trying to get the equivalent of the red box on the bottom(in my real program it is labels and checkboxes) to expand to the size of the green box on top(which is also checkboxes in my real ...
2
votes
1answer
30 views
tkinter grid alignment: Python 2.7
I'm having a problem with the grid alignment when I add in a text box.
I've set up a simple GUI with a 3 column wide display. As part fo the GUI I have a text box for entering notes, and a spinbox ...
0
votes
1answer
20 views
Using Tkinter set() attribute with grid layout in python
I've tried a number of different ways to use the Slider set() in tkinter with the grid layout and I cannot get it to recognize the attribute.
Here's a functional version not using set():
master = ...
-1
votes
2answers
31 views
Basic Tkinter/GUI Questions
I'm dirtying my hands with Python's Tkinter, specifically learning OOP for GUIs and have a few questions.
When constructing a class like so:
class Keylogger(Frame):
def __init__(self, ...