Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : Python

¸÷λ´óÏÀ,Python ±àÂëÎÊÌâ

Àý×ÓÊÇÕâÑùµÄ:

>>> str1 = 'С¹·'
>>> str1
'С¹·'
>>> str1.encode('utf-8')
b'\xe5\xb0\x8f\xe7\x8b\x97'
>>> str2 = str1.encode('utf-8')
>>> str2
b'\xe5\xb0\x8f\xe7\x8b\x97'

ÎÒ ......

ÓôÃÆ£¬python 0d0a»»ÐÐÎÊÌâ

import os,sys,zipfile
teststr = open('1.txt').read()
zipFile = zipfile.ZipFile('test.zip','w')
zipFile.writestr('test.txt',teststr)
zipFile.close()

ÉÏÃæµÄ´úÂë,1.txtÀïµÄ»»ÐÐÊÇ0d0a
¿ÉÊÇдµ½zipÀïÃæµÄtest.txtµÄ»»ÐÐÈ·ÊÇ0a
Ϊʲô£¿
Îı¾Ã»Ëùν°É£¬Ñ¹ ......

Ò»¸öPythonС½Å±¾ÔËÐг¬Âý

ÎÒÓÃPythonдÁËÒ»¸öС½Å±¾£¬×÷ÓÃÊÇͳ¼ÆÎÒe:\downloadĿ¼ÏÂÎļþ¶¼°üº¬ÁËÄÄЩÀ©Õ¹Ãû£¬²¢´òÓ¡³öÀ´£¬µ«ÊDz»ÖªµÀΪʲô£¬Õâ¸ö½Å±¾ËäÈ»¿ÉÒÔÕý³£µÄÔËÐУ¬µ«ÊÇÔËÐеķdz£·Ç³£Âý£¬Æ½¾ùÿһ´ÎÔËÐеÄʱ¼ä¶¼³¬¹ýÁË1·ÖÖÓ²ÅÓнá¹û£¬Çë½Ìһϸ÷λÕâÊÇΪʲô£¿ÊDz»ÊÇÎҵijÌÐòÄÄÀïÉè¼ÆµÄ²»ºÏÀíµ¼Öµģ¿

±¸×¢£º
ÎÒµÄe:\downloadÄ¿Â ......

¡¾ÇóÖú¡¿python´«ÏµÍ³²ÎÊýÎÞ·¨´«È룬¼±£¡

ÎÒÔÚÅú´¦ÀíÖе÷ÓÃpython½Å±¾
ÈçÏ£º
call %pyscript%\StaticResult.py -s D:\DailySDV\Bts8.1\TestLog\TestResult.xml -d %CiRoot_WndPath%\cruisecontrol\userData\groups\group01\projects\%ProjectName%\%GtrRltPath%\!GtrRltNameStr!.xml -t %CiRoot_WndPath%\cruisecontrol\userData\groups\group01\projects\%Proje ......

Python ÖÐÈçºÎдif

python

content=str.find('ok')  &&  content=str.find('not ok')

ÕâÑù±íʾ ÔÚÄÚÈÝÖÐÕÒµ½ ok  »òÕß ÕÒµ½ not ok ¶ÔÂð£¿
²¢ÁÐÌõ¼þÓà and ¶ø²»ÊÇ&&
»òÕßÌõ¼þÓà or ¶ø²»ÊÇ||

ÄãµÄÒâ˼Ӧ¸ÃÊÇor ÄãÊǶ¼´íÁË

ÕÒ±¾½Ì³Ì¿´¿´°É£¬¿ÉÒÔgoogleËÑË÷python ......

¹ØÓÚpython class£º callerRefµÄÎÊÌâ

Python code:

class A:
def __init__(self):
self.B_Handle = B_Handle
self.VA = "A_init"
print "Class A init"
def __getattr__(self, name):
print "A.__getattr__"
print "name=%s" % name
def callref(sel ......
×ܼǼÊý:175; ×ÜÒ³Êý:30; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [1] [2] [3] [4] 5 [6] [7] [8] [9] [10]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ