tk

Can't find package BLT

吃可爱长大的小学妹 提交于 2020-01-17 13:26:44
问题 I am having a problem of getting BLT to work with Tcl/TK. I installed BLT library for TCL/TK but when i try running a tcl program to plot a graph, it keeps giving me an error saying "can't find package BLT". In my program I have already included: package require BLT I also appended the BLT part to my environmental variable on my windows operating system 32 bit but it still doesn't work. Please what do i need to do? 回答1: To make that work, the directory containing the BLT package needs to be

Can't find package BLT

你。 提交于 2020-01-17 13:22:13
问题 I am having a problem of getting BLT to work with Tcl/TK. I installed BLT library for TCL/TK but when i try running a tcl program to plot a graph, it keeps giving me an error saying "can't find package BLT". In my program I have already included: package require BLT I also appended the BLT part to my environmental variable on my windows operating system 32 bit but it still doesn't work. Please what do i need to do? 回答1: To make that work, the directory containing the BLT package needs to be

Tkinter GUI not in proper place

六月ゝ 毕业季﹏ 提交于 2020-01-17 06:06:46
问题 I am trying to create a Tkinter GUI a grey box with a label at the top, then below that a drop down box and with a label to its left describing it and below that another drop down box with a label to its left. Instead I am getting the label in the proper place but then the two drop down boxes and labels are on top of each other even though they are in different frames. from Tkinter import * import ttk class review_gui(): def __init__(self): self.root = Tk() self.EDM_GUI(1) self.root.mainloop(

Python Tkinter: Have Entry receive keys while Menu is posted?

China☆狼群 提交于 2020-01-17 03:45:11
问题 I want to have an Entry with a dropdown Menu autocomplete... kind of like Chrome's omnibar, for example. One issue I'm having is that once the menu gets posted (displayed), it seems to intercept all key press events, and I don't see a way to redirect them anywhere else. Here's some simplified code that reproduces the issue: from Tkinter import Entry, Menu, Tk def menuKey(event): print('Key pressed in a menu.') def showMenu(event): menu = Menu(root, tearoff = 0) menu.add_command(label = 'Just

TK/TCL, trouble understanding this tic tac toe code snippet

旧巷老猫 提交于 2020-01-17 02:51:04
问题 Can anyone help explain to me what the snippet below does. This code snippet is taken from http://wiki.tcl.tk/12374. It is meant to create a tic tac toe game. There are not many resources out there for understanding Tk/Tcl so this is giving me significant difficulty. proc DrawBoard {{redraw 0}} { global S B GAME C if {$redraw} { ;# Must redraw everything .c delete all set w2 [expr {$B(w2) - 15}] ;# Make a little margins set h2 [expr {$B(h2) - 15}] set hbar [expr {$h2 / 3.0}] set vbar [expr {

332.重新安排行程

情到浓时终转凉″ 提交于 2020-01-15 05:10:46
难度:中等 题目描述: 思路总结 : 方法一:字典,优先队列,DFS递归。 这个方法属实精彩,利用了最小堆的排序特性满足了题目中的说明1,对于一些特殊用例,比如循环返回图(具体见参考1)使用DFS递归,实现了先存较小的,也很好的满足了说明1。 参考阅读: Java题解,思路最详细 Python优先队列模块heapq 题解一: import heapq class Solution : def findItinerary ( self , tickets : List [ List [ str ] ] ) - > List [ str ] : #思路:将其转换为字典,其中每个值为一个heap,然后一个个往后查 tk = { } for t in tickets : if t [ 0 ] not in tk . keys ( ) : tk [ t [ 0 ] ] = [ ] heapq . heappush ( tk [ t [ 0 ] ] , t [ 1 ] ) res = [ ] self . visit ( tk , "JFK" , res ) return res def visit ( self , tk , pre , res ) : #DFS遍历图 while pre in tk . keys ( ) and len ( tk [ pre ] ) > 0 : nxt =

vscode设置python3.7调试环境(已更新)

佐手、 提交于 2020-01-14 13:14:47
汇总系列: https://www.cnblogs.com/dunitian/p/4822808.html#ai CentOS安装Python3.7: https://www.cnblogs.com/dotnetcrazy/p/9360831.html Update : 2018-08-08 : pip install [--user] rope :让Python对象支持批量重命名(eg:Ctrl+R+R) 独立安装python3的: 用户设置里面添加一下python3的路径即可 附录: 如果先安装Anaconda,再通过anaconda安装VSCode则不用管环境配置(会配置好),如果先安装vscode就自己配置下环境吧: 如果没配置你自己配置一下,以Linux来说:( 先查看路径,再配置 ) 扩充(配置 规范提示 和 格式化 ): 命令参考:pip install [--user] xxx 规范化提示: pycodestyle or flake8(旧名字) 代码格式化: yapf or autopep8 VSCode配置参考 :( Conda 默认安装了 pycodestyle ) 附录:安装本地开发环境Python3.7 sudo apt-get install python3.7 sudo apt-get install python3.7-dbg curl https:/

Closing current window when opening another window

你。 提交于 2020-01-14 06:07:35
问题 I have created a program in python 3.4 using the GUI module tkinter. I want to tweak the code so when a new window is called it will close the current window then open up the new window. As at the moment the current window is just placed behind the new window rather than destroying it. I have attempted to use .destroy() but that prevents the other window opening. I have my procedure which carries out the current window switch below. def help1(self): root2=Toplevel(self.master) HelpWindow=

How do I link the ActiveState distribution of Tcl/Tk to HomeBrew installed Python

时光毁灭记忆、已成空白 提交于 2020-01-13 07:33:31
问题 I am using macOS 10.12.1 Sierra. I am using Python 2.7.12 installed with brew install python but the IDLE gives the warning WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable. Visit http://www.python.org/download/mac/tcltk/ for current information. and sure enough, it crashed frequently. 8.5.9 is the macOS preinstalled version. I can download the stable 8.5.18 from the ActiveState website (as recommend by python, which works with the python installations from python.org (as they

Matplotlib and multiprocessing RuntimeError

微笑、不失礼 提交于 2020-01-13 03:53:06
问题 I'm trying to use multiprocessing and matplotlib together. I'm creating a standard Pool , adding work with apply_async and updating the GUI with apply_async 's callback function, which runs on the Pool's parent process (I verified this with os.getpid() ). Example : from pylab import * from numpy import * from numpy.random import random from multiprocessing import Pool # Output image global out_all out_all = zeros((256, 256)) # Only does something to in_image, doesn't access anything else def