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

½âѹÎļþ¼ÐÖеÄѹËõÎļþ Python½Å±¾

ÏÂÔØÁ˺ܶàѹËõÎļþ£¬¾ÍдÁËÒ»¸ö½Å±¾
ÔÚPythonÖÐʹÓÃwinrarÃüÁËùÒÔÒ»°ãѹËõÎļþ¶¼Ö§³Ö
ÓÐЩѹËõÎļþPythonÖл¹Ã»ÓÐÏàÓ¦µÄ¿â
ÄãµÃÏȰÑwinrarÌí¼Óµ½path»·¾³±äÁ¿ÖÐ
°Ñ´úÂë±£´æÎªrar.py
ÔÚdosÏÂʹÓã¬È磺rar.py "D:\A B\C" mkdir
#rar.py
#decompress with winrar
#arguments :filename directory opt
# opt='mkdir' to create directory with the correspond filename
# opt='direct' to decompress rar files in current directory
# opt='mk&del' to mkdir and delete rar file
import os
import sys
if len(sys.argv)!=3:
print ('wrong arguments\n')
print ('rar.py directory opt\n')
print ('opt=\'mkdir\' to create directory with the correspond filename\n')
print ('opt=\'direct\' to decompress rar files in current directory\n')
print ('opt=\'mk&del\' to mkdir and delete rar file\n')
exit(0)
#-ibck ,minimized when running
opt=sys.argv[2]
os.chdir(sys.argv[1])
for file in os.listdir('.'):
if os.path.isfile(file) and os.path.splitext(file)[1]=='.rar':
if opt=='mkdir':
cmd='winrar x -ibck "'+file+'"'+' "'+os.path.splitext(file)[0]+'"\\'
os.system(cmd)
elif opt=='direct':
cmd='winrar x -ibck "'+file+'"'
os.system(cmd)
elif opt=='mkdel':
cmd='winrar x -ibck "'+file+'"'+' "'+os.path.splitext(file)[0]+'"\\'
os.system(cmd)
os.remove(file)
else :
print('wrong option')



Ïà¹ØÎĵµ£º

²ÂÊý×Ö——Python°æ

Õâ¸öÊÇ1.10°æ±¾µÄ²ÂÊý×Ö£¬ËäÈ»´úÂë»ù±¾²»±ä£¬µ«ÊDZäµÄÊÇ˼ά·½Ê½£¬²»ÔÙÊÇÓÃÃæÏò¹ý³ÌµÄ·½·¨£¬¶ø¸ÃΪÓÃÀàÀ´ÊµÏÖ£¬±È½ÏǰºóµÄ´úÂ룬ÕâÒ»¸ö¼ò½à¶àÁË£¬¶øÇÒ¸üÈÝÒ×Àí½â£¡
¸üУº
#1.0°æ±¾ÖеÄÌáʾÀàÐÍÊÇ£ºAABB£¬¼òµ¥µÄ˵¾ÍÊÇÏà¶ÔλÖõÄÊý×Ö¶ÔÁ˾ÍÏÔʾA£¬´íÁ˾ÍÏÔʾB£»
#ÏÖÔÚµÄÌáʾ¸ÄΪ£º0A4B¸ñʽ£¬Ò²¾ÍÊÇ˵²»ÌáʾÄǸöλÖõÄÊý× ......

ʹÓÃpy2exe´ò°üpython½Å±¾£¨except 2.6£©

Ò»¡¢¼ò½é
py2exeÊÇÒ»¸ö½«python½Å±¾×ª»»³ÉwindowsÉϵĿɶÀÁ¢Ö´ÐеĿÉÖ´ÐгÌÐò(*.exe)µÄ¹¤¾ß£¬ÕâÑù£¬Äã¾Í¿ÉÒÔ²»ÓÃ×°python¶øÔÚwindowsϵͳÉÏÔËÐÐÕâ¸ö¿ÉÖ´ÐгÌÐò¡£
py2exeÒѾ­±»ÓÃÓÚ´´½¨wxPython,Tkinter,Pmw,PyGTK,pygame,win32com clientºÍserver,ºÍÆäËüµÄ¶ÀÁ¢³ÌÐò¡£py2exeÊÇ·¢²¼ÔÚ¿ªÔ´Ðí¿É֤ϵġ£
¶þ¡¢°²×°py2exe ......

PythonÔªÀà

±³ºóÓÐÒ»´óÌ×µÄÀíÂÛ £¡£¡¹ÜËüÄØ£¡£¿ÀíÂÛÄܵ±·¹³ÔÂð£¿
ÏÈÖªµÀÔõôÓÃÔÙ˵£¡
¼Çס£ºÔªÀà¾ÍÊÇÀàµÄÄ£°å——Ì«ÐÎÏóÁËÁËѽ£¬»ô»ô¡£
ÎÒÒªÒ»´óȺµÄÀà¶¼¾ßÓÐÒ»ÖÐÌØµã£¬ÎÒÔõô¸øËûÃǼÓÉÏÄØ£¿Ä£°åÄ£°åÂð£¬ÎÒ´ÓÕâ¸öÄ£°å´´½¨Ò»ÈºÀ಻¾ÍOKÁË£¿ÄǾÍÐèÒªÔªÀàÁË¡£»ô»ô¡·
¶¨ÒåÒ»¸öÔªÀࣨ¾ÍËùÒ»¸öÀàµÄÄ£°å£¡Äª¶àÏ룬»¹Òª¼ÇסÕâÊÇÀ ......

ʹÓÃpython²Ù×÷´®¿Ú

Ò»¡¢
ΪÁËʹÓÃpython²Ù×÷´®¿Ú£¬Ê×ÏÈÐèÒªÏÂÔØÏà¹ØÄ£¿é:
1. pyserial (http://pyserial.wiki.sourceforge.net/pySerial)
2. pywin32 (http://sourceforge.net/projects/pywin32/)
¶þ¡¢
google “python ´®¿Ú ²Ù×÷”¹Ø¼ü×Ö£¬ÕÒµ½Ïà¹Øpython´úÂ룬
ÎÒÊÇ´Óhttp://currentlife.blog.sohu.com/53741351.htmlÒ³ÃæÉÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ