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

python中文目录

 如有一路径"e:/software/测试.txt" 
需要通过pyhon读/写 "测试.txt"文件,可以采用下面的方法: 
ipath = "e:/software/测试.txt" 
uipath = unicode(ipath , "utf8") 
然后用"uipath"经过编码后的路径去open()即可。 
下面是我在项目中用python读写excel的一点体会(解决了读中文文件名问题,其实中文目录路径也一样): 
def transExcel( inPath ) : 
        excelApp = Dispatch("Excel.Application") 
        inWorkbooks = excelApp.Workbooks.Open( unicode( inPath, "utf8" ) ) 
        #测试下inWorkbooks这个东东有地址么? 
        print "transExcel...",inWorkbooks 
transExcel("e:/software/测试.xls")


相关文档:

Python监视进程


由subprocess创建一个进程,然后进行监视
每一秒钟查看一次,如果正在运行,打印pid和running,如果已停止,,继续执行任务并打印Termined
shell和stdout均设置为False
也许这对做病毒的守护进程很好
#!/usr/bin/env python
import subprocess , sys , time
p=subprocess.Popen(['ping','127.0.0.1','-n','10'], she ......

深入 GalCon:Python、游戏开发和人工智能

Alex. J. Champandard
赖勇浩(http://laiyonghao.com) 译
原文地址:http://aigamedev.com/open/interviews/inside-galcon-python-ai/
AiGameDev.com在这个周一的 pratical insights 是对Phil Hassey采访。Phil 是一个独立游戏开发者,也是游戏产业社区的活跃分子。他曾赢得2006年4月的 Ludum Dare 比赛(这个比赛关注 ......

Python & XML


Chapter 1
Python and XML
Python and XML are two very different animals, each with a rich
history. Python is a full-scale programming language that has grown
from scripting world roots in a very organic way, through the vision
and guidance of Python's inventor, Guido van Rossum. Guido continue ......

正则表达式与python

 在Python中有一个非常重要也非常好用的模块re,在import re后,就能够在Python中使用正则表达式,源于此次项目要用正则表达式对html代码提取一定的字符,所以在这也就用些小例子来熟悉一下正则表达式
现在就用最简单的例子
import re
s='<title>http://www.baidu.com</title>'
print re.findall(r'&l ......

python 判断是不是中文字

 下面这个小工具包含了 判断unicode是否是汉字,数字,英文,或者其他字符。 全角符号转半角符号。 unicode字符串归一化等工作。 还有一个能处理多音字的汉字转拼音的程序,还在整理中。
 
#!/usr/bin/env python
# -*- coding:GBK -*-
"""汉字处理的工具:
判断unicode是否是汉字,数字,英 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号