tk

Python embeddable zip: install Tkinter

≯℡__Kan透↙ 提交于 2019-12-04 20:24:57
问题 Python embeddable zip comes without pip and Tkinter. It is easy to install pip with get-pip.py in the embeddable zip. How can we install Tkinter too (assuming we do not have an existing Python installation in the same machine)? 回答1: Assuming you are on Windows and you also have a regular Python distribution installed (same version of the embedded distribution), to install Tkinter in the embedded distribution you can copy the following files from the regular Python distribution: tcl folder to

How to implement a button whose functionality is a cross between radiobutton and checkbutton?

非 Y 不嫁゛ 提交于 2019-12-04 18:47:15
I want to dynamically disable or enable checkbutton s based on the options the user selects. What I would like is a cross between radiobutton and checkbutton . checkbutton .c1 -text "C1" -variable c1 checkbutton .c2 -text "C2" -variable c2 checkbutton .c3 -text "C3" -variable c3 checkbutton .c4 -text "C4" -variable c4 grid .c1 -sticky w grid .c2 -sticky w grid .c3 -sticky w grid .c4 -sticky w In the above example, if I check C1 , then the options C2 and C4 should be grayed out. Similarly, if I check C3 then C4 should be grayed out. It would be great if there is an elegant method which

How can I control keyboard repeat delay in a Tkinter root window?

时光怂恿深爱的人放手 提交于 2019-12-04 16:10:20
This simple application almost does what I want: import Tkinter as Tk def hello(x): print "Hello" root = Tk.Tk() root.bind("<Up>", hello) root.mainloop() I mash down the up arrow, it prints "Hello" over and over. However, there is a delay before this repetition begins, and the repetition rate is slower than I want. How can I set this repeat delay to zero? How can I control the repeat interval? I know that other Tkinter widgets have configuration options for 'repeatdelay' and 'repeatinterval', but I can't seem to find one for a Tkinter root window. (I'm looking in your direction, Bryan Oakley )

Using Matplotlib with TKAgg or Qt5Agg backend on 4K screen

跟風遠走 提交于 2019-12-04 09:11:14
I'm using Matplotlib 2.0 with Python 3.6 on Ubuntu 16.04 to create plots of data. The computer monitor is 4k resolution at 3840x2160. Plot figures appear really small with tiny font: I have tried the TKAgg and Qt5Agg backends for Matplotlib but the figure window still appears small on my 4K display. Can the backend be configured to scale the figure windows for better viewing on high resolution displays? You can tell matplotlib to create a high dpi figure using plt.figure(dpi=300) before creating your plot. You can save your plot in higher dpi using: plt.savefig("figurename.png", dpi=300) One

Matplotlib and multiprocessing RuntimeError

拜拜、爱过 提交于 2019-12-04 09:04:33
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 do_work(in_image): for x in xrange(100000): out_image = in_image[::-1, ::-1] return out_image # Update

shell 第一天

不羁岁月 提交于 2019-12-04 08:59:52
任务: shell介绍 命令历史 命令补全和别名 通配符 输入输出重定向 shell介绍 shell是一个命令解释器,提供用户和机器之间的交互 作为命令语言,它交互式解释和执行用户输入的命令或者自动地解释和执行预先设定好的一连串的命令 支持特定的语法,比如逻辑判断,循环等 每个用户都可以有自己的特定shell centos7默认shell为bash(bourne agin shell) 还有zsh、ksh等 命令历史 history: 作用:显示历史执行过的命令 [root@tk ~]# history 1 history 2 ls .bash_history 作用:历史命令存放在这个配置文件里,可以通过cat或vim .bash_history来查看 [root@tk ~]# vim .bash_history cd phpwind/ ls cd .. HISTSIZE 作用:内置的环境变量,默认历史命令最大存1000条,可以通过修改环境变量来修改存历史命令的条数 在/etc/profile里面修改,如下: [root@tk ~]# echo $HISTSIZE # 通过这个命令可以看到最多存1000条 1000 [root@tk ~]# vim /etc/profile #找到HISTSIZE,把后面的数字修改成想要改的数就可以 HOSTNAME=`/usr/bin

linux学习第一周

╄→гoц情女王★ 提交于 2019-12-04 08:55:09
第一周作业 1. 按系列罗列Linux的发行版,并描述不同发行版之间的联系与区别 2. 安装Centos7.6操作系统,创建一个自己名字的用户名,并可以正常登录,将主要步骤截图。 3. 配置环境变量,实现执行history的时候可以看到执行命令的时间。 4. 总结Linux哲学思想。 5. 总结Linux常用命令使用格式,并用实例说明。例如echo、screen、date、ifconfig、export等命令 1、按系列罗列linux的发行版,并描述不同发行本之间的联系与区别 Linux 发行版本: Slackware:SUSE ,linux Enterprise Server(SLES) OpenSuse 桌面 Debian:Ubuntu,deepin(深度),mint Redhat:redhat enterprise linux ,centos ,fedora Archlinux:轻量简洁,遵循K.L.S.S原则,(keep IT simple and stupid) Gentoo:极致性能,不提供传统意义的安装程序,下载源代码在本机上编译安装软件 LFS:linux From sxrath 自制linux Android:kernel+busybox(工具集)+Java虚拟机 不同发行版本之间的联系:完整的Linux系统都是由Linux内核加上各种应用程序组成 区别: Red

TclTk library issue while install Rcmdr package on MacBookPro [duplicate]

不羁岁月 提交于 2019-12-04 08:02:32
This question already has an answer here: Error “.onLoad failed in loadNamespace() for 'tcltk'” 6 answers I get the following ERROR while trying to load Rcmdr for R on my MacBook Pro: > library("Rcmdr") Error : .onLoad failed in loadNamespace() for 'tcltk', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/tcltk/libs/tcltk.so': dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /usr/local/lib/libtcl8.6.dylib Referenced from:

tcl script to extract values from multiple text files having same format and generating column based reports

喜夏-厌秋 提交于 2019-12-04 06:24:03
问题 I have the output logs which are created from Seg-Y files. Example : TRACE HEADER==================================================================================================================== MIN MAX MEAN COUNT Trace sequence number within line [001-004]: 1 140400 70200.50 140400 Trace sequence number within SEGY file [005-008]: 1 140400 70200.50 140400 Original field record number [009-012]: 1001 4900 2950.50 140400 Trace number within original field record [013-016]: 1 36 18.50 140400

Ruby require 'tk' yields LoadError: no such file to load — tk

旧城冷巷雨未停 提交于 2019-12-04 05:18:45
I'm not able to get ruby to require 'tk' successfully. I'm using rvm, ruby 2.0.0, ActiveTcl-8.6, and Ubuntu 12.04 LTS. I have run wish provided with ActiveTcl and it seems to be working. I've looked on the RVM site http://rvm.io/integration/tk and several StackOverflow questions like this one RVM Ruby with TK installation (OSX) . I have tried rvm reinstall 2.0.0 --enable-shared --enable-pthread --with-tk --with-tcl several times on different versions of ruby with no success. Any thoughts? When I run irb and do require'tk' I get the following: LoadError: cannot load such file -- tk from /home