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

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("样本".decode("utf-8"))
5、代码里的u前缀会自动生成unicode字符串(它跟据源码首部的#coding:*** 段来决定应该怎样由multibyte生成unicode)
6、python 的print将输出binary block给console,colsole将用系统的multibyte_encode_method为显示这些binary block
REF
http://blog.sina.com.cn/s/blog_620c017e0100erh8.html


相关文档:

python写的将一些类型的文件压缩为7z格式

#将一些类型的文件压缩为7z.py
#for folder all file do 7z
import os
import sys
import distutils.file_util
def ImportOkFile():
    if(os.path.isfile("D:\\Records\\将一些类型的文件压缩为7z_record.txt")==False):
        f=open("D:\\Reco ......

python 读http小记

conn = httplib.HTTPConnection(EPG_IP + ":" + HTTP_PORT)
url = FAV_URL_PARTH +"userid=" + USER_ID + FAV_DIR_MODIFY
param = '''<ps100request id="Favorite.Category.modify">
<categoryid>'''+categoryid+'''</categoryid>
<categoryname>'''+categoryname+'''</ ......

Python之美 Decorator深入详解(一)

There should be one—--and preferably only one –--obvious way to do it.
                                     ......

Python通讯簿

这两天在学习python语言,也学着写了个通讯簿,练习入门下!
功能包括以下:
1、增加一条记录
2、删除一条记录
3、修改一条记录
4、查询一条记录
5、显示整个通讯簿
6、帮助提示
7、版本显示
8、退出等
首先建立一个Person类,即Person.py文件,用来保存联系人记录:
class Person:
def __init__(self, nam ......

Python 下载网页的几种方法

总结下,Python 下载网页的几种方法
1
 fd = urllib2.urlopen(url_link)
 data = fd.read()
 这是最简洁的一种,当然也是Get的方法
2
通过GET的方法
def GetHtmlSource(url):
    try:
   
        htmSource = ''
 &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号