½âѹÎļþ¼ÐÖеÄѹËõÎļþ 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')
Ïà¹ØÎĵµ£º
from random import randint #µ¼ÈëËæ¼´º¯Êý
def guessNum(): &nbs ......
PythonÓïÑÔ
: µ¼³öÓÊÏäÀïµÄÁªÏµÈË£ºÖ§³ÖGmail£¬126£¬ÍøÒ×£¬ËѺü£¬Hotmail£¬ÐÂÀË£¬ÑÅ»¢£¬MSN
#!/usr/bin/env python
#coding=utf-8
from
BeautifulSoup
import
BeautifulSoup
import
os
,
urllib
,
urllib2
,
pdb
import
cookielib
import
httplib
import
csv
,
re
GDATA_URL
=
'/accoun ......
* PYTHON Ç÷ÏòÓÚ½«¹¦ÄÜÏà½üµÄ¶ÔÏó·Å½øÒ»¸öMODULE£¨Îļþ£©À²»Óõ£ÐĶÔÏó»áÌ«´ó£¬ÒòΪÈç¹û¶ÔÏóÌ«´óÁË£¬ÄÇËü¿ÉÄÜÊÇ×öµÄÊÂÐÔÌ«¶àÁË
ÐèÒª±»Öع¹¡¢·Ö½â¡£
* ¿ª·¢¸¨Öú¹¤¾ßÊÇ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 Mono). The module named "serial" automatically selects the appropriate backend.
It is re ......
Ò»¡¢
ΪÁËʹÓÃ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Ò³ÃæÉÏ ......