tk

Get data out of a tcltk function

依然范特西╮ 提交于 2019-12-18 06:19:20
问题 This is probably so simple I will cringe when the answer comes back but I am totally stumped. I have tried the manuals, tried searching the web, assorted examples and anything else I can think of. I am still stuck. I am trying to create a simple input for the user to add two values I can then use in the rest of the R script. I need the script to pause and wait for the input from the user and then continue along once it gets the input (like how the choose file function works). AFter reading a

Widget to Display subprocess stdout?

亡梦爱人 提交于 2019-12-18 05:27:05
问题 I have a python based tkinter script which executes some commands using subprocess module. I need to display the standard output on the GUI itself. Since I am new to tk (One week Bold :) ), I need your advice How should i proceed. I have two queries: Which widget should I learn to display the stdout. How to link the stdout of subprocess to the widget you have mentioned. 回答1: You may want to use the Tkinter.Text widget, described here. The description is quite long, but what you need to

Python 3 Tkinter - Messagebox with a toplevel as master?

↘锁芯ラ 提交于 2019-12-18 04:52:46
问题 I've found that when a toplevel widget calls a messagebox dialog (like "showinfo"), the root window is showed up, over the toplevel. Is there a way to set the Toplevel window as the master of the messagebox dialog ? Here is a script to reproduce this : # -*- coding:utf-8 -*- # PYTHON 3 ONLY from tkinter import * from tkinter import messagebox root = Tk() root.title('ROOT WINDOW') Label(root, text = 'Place the toplevel window over the root window\nThen, push the button and you will see that

Tkinter: windows without title bar but resizable

蹲街弑〆低调 提交于 2019-12-18 03:38:32
问题 What I know is if I want to create a window without title bar, I can write root = Tk() ........ root.overrideredirect(1) But I would also like the window to be resizable. Is there any solution? (FYI: I am working on Windows machine, although I am not sure if it really matters. It will be perfect if there is OS-independent solution, but I am happy if there is at least a solution for Windows first.) 回答1: The problem is, the window is resizable, but when you turn on overrideredirect you lose any

Install tkinter and python locally

北战南征 提交于 2019-12-17 23:33:02
问题 I work with linux on a servies. And I don't have the root privilege. I installed the python-3.2.3 locally to "/home/sam/install_sam". when I import the tkinter module. I get the following error: ImportError: No module named _tkinter, please install the python-tk package I know I need to install the Tkinter module. because I don't have the root privilege. I can't use like the following commands: apt-get install python-tk sudo apt-get install python-tk And I search on goolge. I get tcl/tk from

Why some characters can not be typed in Python's IDLE?

雨燕双飞 提交于 2019-12-17 20:21:58
问题 I don't know how to explain this, actually I'm looking for the explanation, so I'll just mention some steps to reproduce the issue. Hopefully someone will be able to understand and elaborate: Python 3.5.0 on Windows 8.1. (However this should be reproducible regardless of Python and Windows version.) Having Persian standard keyboard Installed. (It can be downloaded from here. Again I'm sure the problem is not limited to this specific keyboard and there are some characters in some other

49-tkinter窗口的隐藏与显示

六月ゝ 毕业季﹏ 提交于 2019-12-17 06:12:02
import tkinter as tk # 导入tkinter模块 import tkinter.messagebox # 计算窗口居中的位置 def get_window_positon(width, height): window_x_position = (root.winfo_screenwidth() - width) // 2 window_y_position = (root.winfo_screenheight() - height) // 2 return window_x_position, window_y_position if __name__ == '__main__': # 创建一个窗口 root = tk.Tk() # 设置窗口最小大小 tk_width = 600 # 窗口的宽度 tk_height = 500 # 窗口的长度 root.minsize(tk_width, tk_height) root.resizable(0, 0) # 来禁止调节大小 pos = get_window_positon(tk_width, tk_height) #调用get_window_positon()方法 root.geometry(f'{tk_width}x{tk_height}+{pos[0]}+{pos[1]}') # 窗口的大小与位置 # 设置标题

Error “.onLoad failed in loadNamespace() for 'tcltk'”

随声附和 提交于 2019-12-17 04:07:46
问题 I have a general question about how to effectively load any kind of external package into R. I have found that many sources detailing this information are simply insufficient, but I will leave out mentioning those respective URLs. I have successfully loaded external packages into R before, but I am having difficulties loading the fgui package. In my specific case, I cannot load the library fgui into R Studio. First I download directly from CRAN with the command: install.packages("fgui", lib="

Why are multiple instances of Tk discouraged?

爱⌒轻易说出口 提交于 2019-12-16 19:55:38
问题 Consider below example: import tkinter as tk root = tk.Tk() root.title("root") other_window = tk.Tk() other_window.title("other_window") root.mainloop() and also see below example that creates instances of Tk back-to-back instead of at once, so there's exactly one instance of Tk at any given time: import tkinter as tk def create_window(window_to_be_closed=None): if window_to_be_closed: window_to_be_closed.destroy() window = tk.Tk() tk.Button(window, text="Quit", command=lambda arg=window :

Why are multiple instances of Tk discouraged?

爷,独闯天下 提交于 2019-12-16 19:55:36
问题 Consider below example: import tkinter as tk root = tk.Tk() root.title("root") other_window = tk.Tk() other_window.title("other_window") root.mainloop() and also see below example that creates instances of Tk back-to-back instead of at once, so there's exactly one instance of Tk at any given time: import tkinter as tk def create_window(window_to_be_closed=None): if window_to_be_closed: window_to_be_closed.destroy() window = tk.Tk() tk.Button(window, text="Quit", command=lambda arg=window :