Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

±£´æÖ¸¶¨Îļþ¼ÐϵÄĿ¼ºÍÎļþÃûµ½ÎļþÖÐ Python ½Å±¾

ÕæÊǵ¹Ã¹£¬¸ÕÂò²»¾ÃµÄÒÆ¶¯Ó²ÅÌ£¬×òÌìɾ³ýÒ»¸ö·ÖÇøÊ§°Üºó£¬¼¸¸ö·ÖÇø¶¼²»¼ûÁË£¬ÄÃÈ¥ÐÞ£¬Î´¹û
»»Á˸öÐµģ¬µ«ÆäÖÐÊý¾ÝȫûÁË¡£ÄÇÊÇÎÒÆ½Ê±ÊÕ¼¯µÄºÜÓÐÓõÄ×ÊÁÏ
ºÜ¶à¶¼¿ÉÒÔÖØÐÂÏÂÔØ£¬µ«ÔõÄÜÏëÆðÓ²ÅÌÖеÄËùÓж«Î÷
½ñÌì»»Ó²ÅÌ»ØÀ´
¾ÍÏñдһ¸ö±£´æÖ¸¶¨Â·¾¶ÏÂËùÓÐÎļþ¼ÐºÍÎļþÃûµÄ³ÌÐò
ÕâÑù£¬Èç¹û¶«Î÷¶ªÁË£¬¿´¿´ÄÇÀïÓÐЩʲô£¬Ò²¿ÉÁÄÒÔ¸æÎ¿
#filesindir.py for files in directory
#result is a txt file with the name of the directory to record
#cmd:filesindir.py "dirname"
# result will be stored in the directory
#or cmd:filesindir.py "dirname" "directory to store the result"

import os
import os.path
import sys
def dirparser(directory,indent,file):
try:
dirlist=os.listdir(directory)
dirli=[]
for i in dirlist:
if(os.path.isdir(directory+'\\'+i)==True):
dirli.append(directory+'\\'+i)
else:
for ind in range(indent):
file.write(' ')
file.write(i+'\n')
for dir in dirli:
for ind in range(indent):
file.write(' ')
indent+=1
file.write(dir+'\n')
dirparser(dir,indent,file)
indent-=1
except:
file.write(' !!!Access denied\n')
return
if __name__ == "__main__":
argc=len(sys.argv)
dir2rec=''
dir2pla=''
if(argc==1):
print("the command is used like this :")
print(" filesindir.py \"dirname\"")
print(" filesindir.py \"dirname\" \"directory to store the result\"")
sys.exit(0)
elif(argc==2):
dir2rec=sys.argv[1]
dir2pla=sys.argv[1]
else:
dir2rec=sys.argv[1]
dir2pla=sys.argv[2]
indent=0
file=open(dir2pla+'\\'+'filesindir.txt','w')
file.write('files in '+dir2rec+' :\n\n')
dirparser(dir2rec,indent,file)

file.close()

print('Done')


Ïà¹ØÎĵµ£º

´®¿ÚͨѶµÄpythonÄ£¿é——pySerial

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 Mono). The module named "serial" automatically selects the appropriate backend.
It is re ......

Pythonµ¼³öQQ¿Õ¼äµÄÈÕÖ¾

ÓÃPythonµ¼³öQQ¿Õ¼äµÄÈÕÖ¾µ½WordPress
ÎÄÕÂÀ´Ô´£ºhttp://www.keakon.cn/bbs/thread-964-1-1.html·½·¨ºÜ¼òµ¥£¬ÕÒ³öÈÕÖ¾µÄµØÖ·£¬ÔÙ±éÀúÁгöÈÕÖ¾µÄÄÚÈÝ¡£
ÒòΪµ¥´¿µ¼³öûÓ㬻¹µÃת»»³ÉÆäËû¸ñʽ£¬ËùÒÔÎÒ±£´æµ½Ò»¸öÁбíÀÿƪÈÕÖ¾¶¼¶ÔÓ¦ÆäÖеÄÒ»¸ö×ÖµäÔªËØ£¬×ÖµäµÄÊôÐÔ¶¼ÓÃunicode±àÂë¡£
È»ºódump³öÀ´£¬¿ÉÒÔ·½±ãÒÔºóÓÃPyth ......

pythonѧϰ±Ê¼Ç——pcap×¥°ü

½ñÌì¿´¿´ÈçºÎÓÃpythonʵÏÖ×¥°ü¡£
    ÒÔǰÎÒÃÇÔøÓùýwinpcapʵÏÖ×¥°ü£¬Æäʵ½ñÌìÎÒÃÇ»¹ÊÇÓÃËü£¬Ö»²»¹ýÊÇËüÔÚpythonϵÄÄ£¿é£¬ÔÚÓÃ֮ǰÎÒÃDZØÐëÏÈÏÂÔØÁ½¸ö¿â£¬pcap¿âºÍdpkt¿â£¬Õâ¸ö¿ÉÒÔÔÚGoogle codeÀïºÜÈÝÒ×ÕÒµ½£¬ÐèҪעÒâµÄÊÇpcapÖ»Ö§³Öµ½python2.5 £¬ËùÒÔÎÒÃÇÒªÓÃ2.5À´±àд¡£
    °²×°ÍêÁ ......

Python 3 µÄÐÂÌØÐÔ

Python 3 ÊÇ Guido van Rossum ¹¦ÄÜÇ¿´óµÄͨÓñà³ÌÓïÑÔµÄ×îа汾¡£ËüËäÈ»´òÆÆÁËÓë 2.x °æ±¾µÄÏòºó¼æÈÝÐÔ£¬µ«È´ÇåÀíÁËijЩÓï·¨·½ÃæµÄÎÊÌâ¡£±¾ÎÄÊÇϵÁÐÎÄÕÂÖеĵÚһƪ£¬½éÉÜÁËÓ°Ïì¸ÃÓïÑÔ¼°Ïòºó¼æÈÝÐԵĸ÷Öֱ仯£¬²¢ÇÒ»¹ÌṩÁËÐÂÌØÐԵöÀý×Ó¡£
Python °æ±¾ 3£¬Ò²±»³ÆÎª Python 3000 »ò Py3K£¨·ÂЧ Microsoft® Windows ......

python Êý¾Ý¿â

def Start(self):
        if (self.conn == None) or (self.conn.State == 1):
            self.conn = win32com.client.Dispatch(r'ADODB.Connection')
          &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ