易截截图软件、单文件、免安装、纯绿色、仅160KB

Python TKinter Gui: Toplevel window

#from pp3e Chapter 9.3
#############################################################################
# popup three new window, with style
# destroy() kills one window, quit() kills all windows and app; top-level
# windows have title, icon, iconify/deiconify and protocol for wm events;
# there always is an app root window, whether by default or created as an
# explicit Tk() object; all top-level windows are containers, but never
# packed/gridded; Toplevel is like frame, but new window, and can have menu;
#############################################################################
    
from Tkinter import *
root = Tk()                                                     # explicit root
    
trees = [('The Larch!',          'light blue'),
         ('The Pine!',           'light green'),
         ('The Giant Redwood!', 'red')]
    
for (tree, color) in trees:
    win = Toplevel(root)                                        # new window
    win.title('Sing...')                                        # set border
    win.protocol('WM_


相关文档:

Python 线程池的实现

import urllib2
import time
import socket
from datetime import datetime
from thread_pool import *

def main():
url_list = {"sina":"http://www.sina.com.cn",
"sohu":"http://www.sohu.com",
"yahoo":"http://www.yahoo.com",
"xiaonei":"http://www.x ......

如何运行Python脚本

假设你你的操作系统是WinXP:

开始菜单-> 运行-> cmd

然后就可以敲命令了。

如果你用IDLE,可以用IDLE打开这个.py文件,然后在菜单 "Run "下有一项 "Run   Module ",点击即可。 ......

Linux下python lxml模块的安装

需要先安装libxml2-devel libxslt-devel这两个rpm包,如果使用非root用户安装,可以下载libxml2和libxslt的源代码进行安装。 libxml2-devel、libxslt-devel装好后,解压lxml的包,切换到这个包的路径。
加入CFLAGS进行编译和安装,在shell下依次输入如下命令: CFLAGS=-I/usr/include/libxml2:/usr/include/libxslt/ ......

基本数据结构的python实现 堆栈

前言:
最近又想学习python,又想去温习一下算法,于是就想出了这个两不误的方法,^_^
堆栈:
使用python的列表结构,详情可以查看help(list)
#Filename: stack.py
shoplist=['apple','mango','carrot','banana']
shoplist.append('rice')
popitem=shoplist[-1]
del shoplist[-1]
print 'the popitem is',popitem
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号