tk

Widget to Display subprocess stdout?

孤人 提交于 2019-11-29 08:48:57
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. Joël You may want to use the Tkinter.Text widget, described here . The description is quite long, but what you need to understand is mainly that this widget can be used as a buffer, as text should be inserted inside. So, for

multiple comboboxes in R using tcltk

会有一股神秘感。 提交于 2019-11-29 08:17:46
I have been trying to define multiple combo boxes in R using the tcltk package but to no avail. I am using the below code. My inspiration was here , however I can't seem to just label them comboBox1, comboBox2, etc... so I decided to try and set their output values into a vector... but their output values don't make any sense to me... any ideas out there? many thanks require(tcltk) tclRequire("BWidget") tt <- tktoplevel() tkgrid(tklabel(tt,text="What's your favorite fruits?")) fruit <- c("Apple","Orange","Banana","Pear") num <- c(0:3) num.fruit <- cbind(num, fruit) #####1st box comboBox <-

tclstub issue while using homebrew to install graphviz

喜欢而已 提交于 2019-11-29 07:58:25
Homebrew quits when trying to install graphviz, CCLD libtcldot_builtin.la ld: library not found for -ltclstub8.6 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[4]: *** [libtcldot.la] Error 1 make[4]: *** Waiting for unfinished jobs.... ld: library not found for -ltclstub8.6 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[4]: *** [libtcldot_builtin.la] Error 1 make[3]: *** [install-recursive] Error 1 make[2]: *** [install-recursive] Error 1 make[1]: *** [install-recursive] Error 1 make: *** [install] Error 2 an issue

Tkinter's overrideredirect prevents certain events in Mac and Linux

僤鯓⒐⒋嵵緔 提交于 2019-11-29 03:44:11
I am writing a program in Python with a Tkinter UI. I want to have a small window with no title bar. This window must receive keyboard input. I am not picky whether this is in the form of an Entry widget or just binding to KeyPress. overrideredirect(True) is typically how the title bar is disabled. Unfortunately, (except in Windows), this seems to prevent many events from being received. I wrote this code to illustrate the problem: #!/usr/bin/env python from __future__ import print_function import Tkinter class AppWindow(Tkinter.Tk): def __init__(self, *args, **kwargs): Tkinter.Tk.__init__

Tkinter: windows without title bar but resizable

好久不见. 提交于 2019-11-29 02:15:12
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.) Bryan Oakley The problem is, the window is resizable, but when you turn on overrideredirect you lose any sort of header or edge that you can grab in order to resize the window. The only solution is

Tkinter: Treeview widget

可紊 提交于 2019-11-29 02:06:15
At the moment I am working on a program that has its own project files and inside that are like sub-files and I want to know how to use the treeview widget to display all the sub-files inside the project file, Any Ideas? Thanks in advance! There is an example in the source code of CPython of how to fill a Treeview recursively with the content of a directory, this is basically how it works (I have removed the event bindings and wrapped it in a class for better readability): import os import tkinter as tk import tkinter.ttk as ttk class App(tk.Frame): def __init__(self, master, path): tk.Frame._

Install tkinter and python locally

不羁的心 提交于 2019-11-28 20:51:26
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 here . I install them use the following commands. cd ~/Downloads/tcl8.5.11/unix ./configure --prefix=

解决 Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. 问题

大城市里の小女人 提交于 2019-11-28 20:10:13
1, 安装 tk-dev 和 python3-tk sudo apt-get install tk-dev sudo apt install python3-tk 2,修改 matplotlibrc 文件 sudo geidt ~/.../lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc 搜索:#backend : Agg 替换为: backend : TkAgg 3,如果需要,重新安装 matplotlib: pip uninstall -y matplotlib pip --no-cache-dir install -U matplotlib 来源: https://blog.csdn.net/Merlin_Bloom/article/details/100124596

Tcl/Tk examples?

你离开我真会死。 提交于 2019-11-28 18:56:59
Tcl/Tk is a simple way to script small GUIs. Can anyone give a nice example with a button and a text widget. When the button is pressed should a shell command be executed and the output piped to the text widget. If you have other nice and clean examples for useful tasks, please add them too. Here's a more complete example using fileevents. This will auto-scroll all the time. For usability purposes you probably only want to auto-scroll if the bottom of the text is visible (ie: if the user hasn't moved the scrollbar) but I'll leave that as an exercise for the reader to keep this already long

The Simplest Steps to Converting TCL TK to a Stand Alone Application

混江龙づ霸主 提交于 2019-11-28 17:34:18
After running into major compatitiblity problems with C#, ASP.NET, MS Access, Linux, and Mono, I've decided to program in a language that is cross-platform, open source, and compatible with embedded databases that are also compatible with many platforms. I narrowed my choice down to TCL. Before I began a sample application with TCL, I wanted to see how easy it was to create a stand alone application. I purchased a book entitled "Practical Programming in TCL and TK", downloaded TCLkit, and FreeWrap, yet I am having troubles finding a methodological way to convert TCL in TK (Wish) into a