tkinter

getting selected value of Combobox python

筅森魡賤 提交于 2021-02-05 11:14:27
问题 Hi I have the following code def create(self): geo = StringVar() city = ttk.Combobox(gui, textvariable=geo,state="readonly") city.config(values=self.geo) city.pack() city.bind("<<ComboboxSelected>>", self.cityselection) def cityselection(self,event): selected=event print(selected) I want to send the selected value of from the Combobox to cityselection function but when I print it I only get VirtualEvent event x=0 y=0 and it does not matter which value I choose I will always get the above

numpad in tkinter python [closed]

强颜欢笑 提交于 2021-02-05 11:13:19
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 months ago . Improve this question I am trying to link a numpad to the entry field in my Python code, but i cant get it working. I hope someone can help me with this. Thanks in advance! My code import tkinter as tk from PIL import ImageTk from PIL.ImageTk import PhotoImage from tkinter import Button # background

Python - how to wait for user trigger in the middle of a function?

你说的曾经没有我的故事 提交于 2021-02-05 11:12:27
问题 I want to prompt user to choose between yes and no in the middle of a function and then continue the function accordingly. How is it possible? Here is my code: def download_popup(file_name, url, size, threshold): root = Tk() label = Label(root, text="The file {file} at {url} is {size}Bytes large which is larger than your threshold({threshold})." "\nShall I still download it?".format(file_name, url, size, threshold)) yes = ttk.Button(root, width=5, text="yse", command=lambda: return True) no =

numpad in tkinter python [closed]

放肆的年华 提交于 2021-02-05 11:06:04
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 months ago . Improve this question I am trying to link a numpad to the entry field in my Python code, but i cant get it working. I hope someone can help me with this. Thanks in advance! My code import tkinter as tk from PIL import ImageTk from PIL.ImageTk import PhotoImage from tkinter import Button # background

numpad in tkinter python [closed]

▼魔方 西西 提交于 2021-02-05 11:05:52
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 months ago . Improve this question I am trying to link a numpad to the entry field in my Python code, but i cant get it working. I hope someone can help me with this. Thanks in advance! My code import tkinter as tk from PIL import ImageTk from PIL.ImageTk import PhotoImage from tkinter import Button # background

tkinter doesn't open image via function

自作多情 提交于 2021-02-05 10:50:50
问题 Tkinter doesn't open the image. We can ask the opening incorrectly, we need help. I need it to open the image through the menu. be sure to use pil, as the image can be anything. There are no errors in the syntax. Thank you = ) from tkinter import Tk, Frame, Menu, Canvas, PhotoImage import easygui from PIL import Image, ImageFilter, ImageTk def input_file(): a = easygui.fileopenbox(filetypes=["*.jpg"]) original = Image.open(a) original = original.resize((799, 799), Image.ANTIALIAS) photoimg =

Any way to run python TK scripts on web page?

泄露秘密 提交于 2021-02-05 10:47:26
问题 Is there any way to run a python script that utilizes TKinter on a web page such that a user could run the script and interact with the TK windows without having to download the script or have the appropriate python interpreter? 回答1: No. There is no way to do this. 回答2: The only approach I can think of, is to use some virtual screen protocol such as VNC, run your Tkinter script on a server for that protocol (e.g., a VNC server), and use a viewer browser plug-in for that protocol in the user's

Different shapes of windows in tkinter

天大地大妈咪最大 提交于 2021-02-05 10:41:29
问题 normally when you make a window in tkinter using Tk(), the standard shape of the window would be a square. Is there any way we can make the shape anything else? 回答1: No, you cannot create windows of any shape other than a rectangle. 来源: https://stackoverflow.com/questions/64294866/different-shapes-of-windows-in-tkinter

Ubuntu: _tkinter.TclError: no display name and no $DISPLAY environment variable

佐手、 提交于 2021-02-05 10:39:30
问题 So I'm trying to run a python GUI using tkinter from Ubuntu command line, on Windows 10, and get the following error: brandon@DESKTOP-V5LTF5T:~$ python3 MainApp.py Traceback (most recent call last): File "MainApp.py", line 14, in <module> root = tk.Tk() File "/usr/lib/python3.6/tkinter/__init__.py", line 2023, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: no display name and no $DISPLAY environment

Ubuntu: _tkinter.TclError: no display name and no $DISPLAY environment variable

半世苍凉 提交于 2021-02-05 10:38:06
问题 So I'm trying to run a python GUI using tkinter from Ubuntu command line, on Windows 10, and get the following error: brandon@DESKTOP-V5LTF5T:~$ python3 MainApp.py Traceback (most recent call last): File "MainApp.py", line 14, in <module> root = tk.Tk() File "/usr/lib/python3.6/tkinter/__init__.py", line 2023, in __init__ self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: no display name and no $DISPLAY environment