Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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»·¾³¼´¿É¡£ÒªÔËÐÐÒ»¸öpy³ÌÐò£¬Ö±½ÓË«»÷Õâ¸öpyÎļþ¼´¿É¡£Ò»°ãÇé¿öÏ£¬Ã»ÓÐÌáʾÓû§ÊäÈë»ò¿ØÖÆÆÁÄ»ÏÔʾ£¬´ò¿ªÒ»¸öpyÎļþʱ»áͻȻÉÁÒ»ÏÂÂíÉϾÍÍ˳ö£¬ÕâÊÇÓÉÓÚ³ÌÐòÔËÐÐÒѾ­Íê³ÉÁË¡£ÈôÐèÒªÏÔʾ£¬ÔòÒªÌí¼ÓÒ» ......

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Öг£ÓÃÈÕÆÚ²Ù×÷×ܽá

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×Ö·û´®µÄencodeÓëdecode

 
Ê×ÏÈÒª¸ãÇå³þ£¬×Ö·û´®ÔÚPythonÄÚ²¿µÄ±íʾÊÇunicode±àÂ룬Òò´Ë£¬ÔÚ×ö±àÂëת»»Ê±£¬Í¨³£ÐèÒªÒÔunicode×÷ΪÖмä±àÂ룬¼´ÏȽ«ÆäËû±àÂëµÄ×Ö·û´®½âÂ루decode£©³Éunicode£¬ÔÙ´Óunicode±àÂ루encode£©³ÉÁíÒ»ÖÖ±àÂë¡£
decodeµÄ×÷ÓÃÊǽ«ÆäËû±àÂëµÄ×Ö·û´®×ª»»³Éunicode±àÂ룬Èçstr1.decode('gb2312')£¬±íʾ½«gb2312±àÂëµÄ×Ö· ......

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ºÅ