tk

linux上安装tcl、tk、expect

大兔子大兔子 提交于 2019-12-01 02:54:53
linux上安装tcl、tk、expect 1、tcl安装tcl8.5.9-src.tar.gz cd /tmp tar -zxvf tcl8.5.9-src.tar.gz cd tcl8.5.9/unix/ ./configure --prefix=/usr/local/tcl/ --enable-shared make make install /usr/local/tcl/bin/tclsh8.5 %exit 2、tk安装tk8.5.9-src.tar.gz cd /tmp tar -zxvf tk8.5.9-src.tar.gz cd tk8.5.9/unix/ ./configure --prefix=/usr/local/tk/ --with-tcl=/usr/local/tcl/lib/ --enable-shared make make install ln -s /usr/local/tcl/lib/libtcl8.5.so /usr/local/tk/lib/libtcl8.5.so /usr/local/tk/bin/wish8.5 %exit 3、expect安装expect-5.44.1.15.tar.gz cd /tmp tar -zxvf expect-5.44.1.15.tar.gz cd expect-5.44.1.15 ./configure -

Quantity limitation for dialog window selecting files?

99封情书 提交于 2019-12-01 02:20:41
Python version: 2.7 Tk version: 8.5 Refer to my previous question how to add the selected files from dialog window to a dictionary? I am trying to select 500 files from dialog window and extract their name as keys for a dictionary. Total files size is around 200M. I have no idea why I got an empty dictionary. However, if I choose less files like 100 each time, it works very well at each time. So my question is that is there any quantity limitation for dialog window selecting files or for keys in a dictionary? sys.path.append("C:\MY PATH") os.environ['PATH']+=";C:\MY PATH" print "Please select

What to use instead of NavigationToolbar2TkAgg?

房东的猫 提交于 2019-12-01 02:07:43
问题 When I run the following script: import tkinter as tk import matplotlib import matplotlib.pyplot as plt import matplotlib.figure import matplotlib.backends.backend_tkagg import numpy as np def on_key_event(event, canvas, toolbar): matplotlib.backend_bases.key_press_handler(event, canvas, toolbar) matplotlib.use('TkAgg') root = tk.Tk() root.wm_title('Test window') fig = matplotlib.figure.Figure(figsize=(9.333, 7), dpi=100) a = fig.add_subplot(111) axes = fig.gca() x = np.linspace(0, 2*np.pi,

PDF Viewer for Python Tkinter

懵懂的女人 提交于 2019-11-30 20:36:53
I am currently looking for a possibility to display PDF Files inside a Tkinter application (displaying them e.g. in a Frame widget or similar). Is there already a solution for this problem? I already searched SO, used ddg an others but did not find anything for that purpose. Only thing I found was how to print the contents of a tk.Canvas to PDF - is there a way to load a PDF into a Canvas? Finally I came to a solution I can work with. Using pypdfocr and its pypdfocr_gs library I call pypdfocr.pypdfocr_gs.PyGs({}).make_img_from_pdf(pdf_file) to retrieve jpg images and then I use PIL to get

Inertial scrolling in Mac OS X with Tkinter and Python

半世苍凉 提交于 2019-11-30 17:47:16
I am working on a Python 3.3 project that uses Tkinter as a Window manager. I have mouse scroll wheel events set up for a canvas. The scrolling works in Windows 7, 8, and Ubuntu, but upon scrolling with a Magic Mouse in Mac OS X Mountain Lion, the program crashes with teh following error in the Tk main loop: File "/Users/xxxx/Documents/Repositories/tycoon/agentsim.py", line 291, in start self._root.mainloop() File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/tkinter/__init__.py", line 1038, in mainloop self.tk.mainloop(n) UnicodeDecodeError: 'utf-8' codec can't decode byte

report for PA1

纵然是瞬间 提交于 2019-11-30 15:52:46
说明: % report for PA1 1.ISA=x86 2.关于x86 register 存在的问题,修改前reg.h文件寄存器设置中32,16,8位寄存器空间采用struct分配, 不共用空间,按照x86要求,改为使用Anonymous Union分配,然而发现修改后发现仍然报assertion fail, 检查reg.c 中test的code后,发现assert函数通过检验之后在同一个struct中声明的一系列rtlreg(eax,ecx,etc.)是否与对应寄存器位置相同, 所以要求这一系列rtlreg与gpr之间也采用Anonymous Union分配。 %% PA1.1 fun1.si ​ 利用sscanf(source_str,format,&des)按格式读入参数,注意des参数要用地址表示; ​ 之后根据参数调用相应函数(cpu_exec)即可 ​ 完成之后添加了判断N==0,提示无效(阅读代码框架可知N=-1表示最大uint,有效) fun2.info r ​ 在相应的isa中写好isa相关的isa_reg_display,后调用即可,写的时候利用阅读代码可知直接利用相应的写好的宏定义等(reg_name.reg_b,reg_l,reg_w)即可快速实现 ​ 好看起见,查阅了printf函数中打印16进制相关参数, “%#x” //表示按格式输出, “%nx

Hide console for Tkinter app on OSX

与世无争的帅哥 提交于 2019-11-30 15:48:39
I'm trying to hide the Terminal when I launch a GUI Tkinter based app, but when I double click the app.py file on OSX, the Terminal window appears. I've tried changing the extension to .pyw and tried launching it with /usr/bin/pythonw, but no matter what, the Terminal window still appears. I've even tried adding the try/except below, but when I run it I get the error: 'invalid command name "console"' in the Terminal window that appears. from Tkinter import * class MainWindow(Tk): def __init__(self): Tk.__init__(self) try: self.tk.call('console', 'hide') except TclError, err: print err win =

unremovable text in tkinter

馋奶兔 提交于 2019-11-30 15:23:30
here is some code: from Tkinter import * class Main(object): def __init__(self): self.console = Text(root, relief='groove', cursor='arrow', spacing1=3) self.console.insert(INSERT, '>>> ') self.console.focus_set() self.scroll = Scrollbar(root, cursor='arrow', command=self.console.yview) self.console.configure(yscrollcommand=self.scroll.set) self.scroll.pack(fill='y', side='right') self.console.pack(expand=True, fill='both') root = Tk() root.geometry('%sx%s+%s+%s' %(660, 400, 40, 40)) root.option_add('*font', ('Courier', 9, 'bold')) root.resizable(0, 1) app = Main() root.mainloop() is there some

Expand Text widget to fill the entire parent Frame in Tkinter

社会主义新天地 提交于 2019-11-30 14:50:16
问题 I got this Text widget, and I'd like for it to expand and fill its entire parent, using the Grid geometry manager. According to the examples I've seen, this sample program should work, alas it doesn't, when expanding the window, the contents are not resizing. from Tkinter import * root = Tk() input_text_area = Text(root) input_text_area.grid(row=1, column=0, columnspan=4, sticky=W+E) input_text_area.configure(background='#4D4D4D') root.mainloop() Any help is appreciated For what it's worth, I

Expand Text widget to fill the entire parent Frame in Tkinter

帅比萌擦擦* 提交于 2019-11-30 11:45:13
I got this Text widget, and I'd like for it to expand and fill its entire parent, using the Grid geometry manager. According to the examples I've seen, this sample program should work, alas it doesn't, when expanding the window, the contents are not resizing. from Tkinter import * root = Tk() input_text_area = Text(root) input_text_area.grid(row=1, column=0, columnspan=4, sticky=W+E) input_text_area.configure(background='#4D4D4D') root.mainloop() Any help is appreciated For what it's worth, I'm running in Python 2.7 (latest 2.x version), and coding in PyCharm, though I don't think the IDE is