How do I find out the size of a Canvas text object in tkinter?

I want to create some text in a canvas: myText = self.canvas.create_text(5, 5, anchor=NW, text="TEST") Now how do I find the width and height of myText?

How to create a password entry field using Tkinter

I am trying to code a login window using Tkinter but I'm not able to hide the password text in asterisk format. This means the password entry is plain text, which has to be avoided. Any idea how to do it?

tkinter python maximize window

I want to initialize a window as maximized, but I can't find out how to do it. I'm using python 3.3 and Tkinter 8.6 on windows 7. I guess the answer is just here:...

Difference between tkinter and Tkinter

When I answer Tkinter questions I usually try and run the code myself, but sometimes I get this error: Traceback (most recent call last): File "C:\Python27\pygame2.py", line 1, in <module> ...

Can I change the title bar in Tkinter?

I'm using Tkinter as GUI for my program, but as I see, many programs don't have standard look as Tkinter does. By standard look I mean standard title bar, borders, etc. For example, Tkinter's...

ImportError: No module named 'Tkinter'

For some reason, I can't use the Tkinter or tkinter module. After running the following command in the python shell import Tkinter or import tkinter I got this error ModuleNotFoundError: No...

Tkinter string in a font measures differently than same in Text widget as string grows

The Text object holding a string (in a specified font) seems to give inconsistent results depending on the length of the string. For example: from Tkinter import * import tkFont root=Tk() t_Font...

What's the difference between "update" and "update_idletasks"?

From the effbot.org documentation, we have the following about the update function: Processes all pending events, calls event callbacks, completes any pending geometry management, redraws widgets...

How can I set the text widget contents to the value of a variable in Python/Tkinter?

I am writing a program to assist with a trivial part of my job that can be automated. My purpose here is to: Copy and paste a chunk of plain text into a Tkinter text widget Use that pasted chunk...

Tkinter: How to detect screen size and change text size of Labels?

I have two questions about Tkinter: Is there a way to detect the size of the used screen and adapat the GUI display according to this parameter? How can I change text size in Tkinter in labels?

ttk creating and using a custom theme

I am trying to incorporate a customizable theme choice in my program. I have been referring to this guide: http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/ttk-themes.html, but I am lost. Here is...

PermissionError: [Errno 13] Permission denied

I'm getting this error : Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinter\__init__.py", line 1538, in __call__ return self.func(*args) File...

tkinter in Spyder

I am trying my first steps in tkinter. I use Spyder as IDE in Python 3.5.1 |Anaconda 4.0.0. I want to run the very simple script below but it always crashes my Spyder. In a normal shell/bash it...

How do I get Windows to remember the last directory used using tkinter filedialog?

Having code like: from tkinter import filedialog image_formats= [("JPEG", "*.jpg"), ("All files", "*.*")] file=filedialog.askopenfilename(filetypes=image_formats) I can open a file dialog box...

Tkinter error: Couldn't recognize data in image file

I'm trying to put a jpg image to a tkinter canvas. tkinter gives me this error: couldn't recognize data in image file I use the code from the documentation: canv = Canvas(root, width=80,...

Can I use rgb in tkinter?

Can I use rbg instead of hex in tkinter? If so, how can I do it? I am planning to use this feature to make sort of a gradient from one color to another and I plan to make a for loop to change it...

is there a way to detect a press of a column header of a treeview?

I want the content of a treeview to be ordered depending on what column header the user clicked. I've already tried to use the treeview virtual events but pressing a header didn't fire an event...

Can't run turtle on jupyter notebook (turtle graphic window not responding)

First Question I was doing an example from ThinkPython 2e Chapter 4 Case Study: Interface Design, when I stumbled upon turtle module. I use jupyter notebook as an IDE to do exercise. Here's the...

TypeError: fuction missing 1 required positional argument

I'm doing a tic-tac-toe for school, as it is a homework. I have to use Tkinter. The program used to do the code is "Pyzo". I decided to do a fuction for the winning condition and a fuction for...

How can I install tkinter for Python on Mac?

So I posted this error on a Facebook group, they said I should get pip. I installed pip, when I am wanting to install tkinter it's giving me error: I used this command first : sudo pip install...

Updating Multiple Columns in sqlite3

I am wanting to update multiple columns in my 'Class' Table in sqlite. I do not know how to do this so I approached the same syntax as an 'INSERT' query however, I seem to be having the following...

How to put image uploaded in tkinter into a function?

I am trying to create a Python tkinter application where the user can upload an image from file and the image is put through a image segmentation function which outputs an matplotlib plot. I have...

Unable to import Tkinter

I am using Git Bash to run some code involving Tkinter, but have been unable to run the code and have gotten the error ModuleNotFoundError: No module named 'Tkinter'. I have #!/usr/bin/env/python3...

How to store hashed passwords on SQLite3 database?

I want to store passwords on a sqlite3 database on python, however I don't want to store the passwords in plaintext for obvious reasons. I have used bcrypt to hash the passwords, but I keep...

Retrieve/get back command callback function from TKinter widget

I am (for some elaborate setup reasons) trying to retrieve the actual command callback function from tkinter widgets, for example setting up a callback for a button b import tkinter as tk root =...

Tkinter save canvas and load

I wrote a code which creates canvas and enables you to load picture. You can also add logo and text to this picture and drag. (Something like Photo Watermark Application) After all, you can save...

Python Video Player Using Tkinter

I would like to create a video player that could rewind, fast forward, stop and play using python and tkinter. I am stuck on the fast forward and rewind part. I had found some of the example from...

Problem resizing plot on tkinter figure canvas

Python 3.9 on Mac running OS 11.6.1. My application involves placing a plot on a frame inside my root window, and I'm struggling to get the plot to take up a larger portion of the window. I...

How to deal with two event loops? Pyrogram's and Tkinter's

I am using Pyrogram and Tkinter: from tkinter import * from pyrogram import Client root = Tk() app = Client("my_account") First, I register a handler with Pyrogram: @app.on_message() def...

Threading reading a serial port in Python (with a GUI)

I want to trigger an event whenever there is data to be read from a serial port while running a GUI. The pySerial module apparently has experimental functionality for that, but it isn't...