易截截图软件、单文件、免安装、纯绿色、仅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程序

   Python是一种面向对象的解释性的计算机程序设计语言,也是一种功能强大而完善的通用型语言,已经具有十多年的发展历史,成熟且稳定。Python 具有脚本语言中最丰富和强大的类库,足以支持绝大多数日常应用。它具有简单、易学、免费、开源、可移植性、解释性、面向对象、可扩展性、可嵌入性以及丰富的库等特性, ......

Python字符串操作

 #Python字符串操作
''
'1.复制字符串'
''
#strcpy(
sStr1,
sStr2)
sStr1 =
'strcpy'
sStr2 =
sStr1
sStr1 =
'strcpy2'
print
sStr2
''
'2.连接字符串'
''
#strcat(
sStr1,
sStr2)
sStr1 =
'strcat'
sStr2 =
'append'
sStr1 +
=
sStr2
print
sStr1
''
'3.查找字符'
''
#strc ......

python中常用日期操作总结

http://hbszyandong.javaeye.com/blog/377199
# -*- coding: utf-
8
 -*-  
from datetime import
 datetime  
from datetime import
 date  
from time import
 strftime  
from time imp ......

python 中文乱码 问题深入分析

 
转自:http://hi.baidu.com/%C1%EE%BA%FC%CF%F3/blog/item/efb76fb7f0411dc437d3ca20.html
 
在本文中,以'哈'来解释作示例解释所有的问题,“哈”的各种编码如下:
  1. UNICODE (UTF8-16),C854;
  2. UTF-8,E59388;
  3. GBK,B9FE。
一、python中 ......

Python的串口通讯第三方库PySerial

 最近要用到串口通讯,简单易用的Python又帮上忙了,多亏了庞大的第三方资源~~~ :)
pySerial
Overview
This module encapsulates the access for the serial port. It provides
backends for Python running on Windows, Linux, BSD (possibly any POSIX
compliant system), Jython and IronPython (.NET and M ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号