易截截图软件、单文件、免安装、纯绿色、仅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 中的字符编码

1、str类型可以理解为一个二进制block,或multibyte
2、multibyte_str.decode("<multibyte_encode_method>")  -> unicode
3、unicode_str.encode("<multibyte_encode_method>")  -> multibyte_str(binary block)
4、unicode_str 的操作参数也应为unicode,如:unicode_str.find("样本".deco ......

使用python获取html页面的内容

import urllib
from HTMLParser import HTMLParser
class TitleParser(HTMLParser):
def __init__(self):
self.title = ''
self.divcontent = ''
self.readingtitle = 0
self.readingdiv = 0
HTMLParser.__init__(self)
def handle_starttag(self, tag, attrs): ......

Eclipse Python开发环境

1,下载org.python.pydev.feature-1.5.0.1251989166.zip http://sourceforge.net/projects/pydev/files/
2,安装插件到eclipse
3,重启eclipse
注意:使用1.5.6版本pydev插件,创建python工程会报错,使用1.5.0版本无此问题。 ......

Python Socket编程

1,编写Server.py
import socket
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind(('localhost',8081))
while True:
    data,addr=s.recvfrom(1024)
    print 'receive:',data,'from',addr
2,编写Client.py
import socket
s=socket.socket(socket.AF_INET,socket.SOC ......

编译了windows下的python3连接Mysql的库mypysql


编译了一个windows下的python3连接Mysql的库
mypysql
版本是 0.5.1 ,根据官方的修改日志,这个版本修改了0.5中一个内存泄漏问题。
源代码和编译后的文件为:
http://211.147.215.55/down/mypysql-0.5.1-win.zip
mypysql的官方地址 https://sourceforge.net/projects/mypysql/
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号