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

python os Ä£¿é

Python 3 ½Ì³Ì¶þ:Îļþ,Ŀ¼ºÍ·¾¶
http://www.cnitblog.com/yunshichen/archive/2009/04/01/55931.html
python osÄ£¿é
http://hi.baidu.com/happynp/blog/item/729243f902d5a751242df2c2.html
http://hi.baidu.com/fiber212121/blog/item/6e07ec03c97b6982d53f7c27.html
python getoptÄ£¿é
http://www.tsnc.edu.cn/default/tsnc_wgrj/doc/pythonhtml/html/scripts_and_streams/command_line_arguments.html
http://www.sqlite.com.cn/MySqlite/11/416.Html
http://docs.python.org/library/getopt.html
http://docs.python.org/library/optparse.html
mysqldbback.py
#!/usr/bin/python
import os
import time
import ftplib
import traceback
#config vars
systempathchr="/" #·¾¶·Ö¸î·û£¬*nixÓÃ"/" win32ÓÃ"\\"
dbuser="root" #Êý¾Ý¿âÓû§Ãû
dbpwd="dbpwd" #Êý¾Ý¿âÃÜÂë
dbnamelist=["dbone","dbtwo","dbthree"] #ÐèÒª±¸·ÝÄÇЩÊý¾Ý¿â
workdir="/path/to/backup/" #±¾µØ±¸·ÝÎļþ¼Ð
errlogfile="databack.log" #´íÎóÈÕÖ¾Ãû
ftp_addr="192.168.0.2" #ftpµØÖ·
ftp_port="2102" #ftp¶Ë¿Ú
ftp_user="databack" #ftp̞
ftp_pwd="backpwd" #ftpÃÜÂë
ftp_path="/" #´æ·Åµ½ftp·¾¶
ftpqueue=[]
def ftpstor():
#login
bufsize=1024
ftp=ftplib.FTP()
try:
ftp.connect(ftp_addr,ftp_port)
ftp.login(ftp_user,ftp_pwd)
ftp.cwd(ftp_path)
for filepath in ftpqueue:

#open file for input as binary
f=open(filepath,"rb")
#store file as binary
print getfilename(filepath)
ftp.storbinary("STOR "+getfilename(filepath),f,bufsize)
f.close()
ftp.quit()
except:
path=os.path.join(workdir,errlogfile)
traceback.print_exc(file=open(path,"a"))

def dumpdb(dbname):
global ftpqueue
timeformat="%Y%m%d"
sqlvalformat="mysqldump -u%s -p\"%s\" \"%s\" >\"%s


Ïà¹ØÎĵµ£º

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µÄ´®¿ÚͨѶµÚÈý·½¿â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 ......

pythonÖÐÎÄĿ¼

 ÈçÓÐһ·¾¶"e:/software/²âÊÔ.txt" 
ÐèҪͨ¹ýpyhon¶Á/д "²âÊÔ.txt"Îļþ£¬¿ÉÒÔ²ÉÓÃÏÂÃæµÄ·½·¨£º 
ipath = "e:/software/²âÊÔ.txt" 
uipath = unicode(ipath , "utf8") 
È»ºóÓÃ"uipath"¾­¹ý±àÂëºóµÄ·¾¶È¥open()¼´¿É¡£ 
ÏÂÃæÊÇÎÒÔÚÏîÄ¿ÖÐÓÃpython¶ÁдexcelµÄÒ»µãÌå»á(½â¾öÁ˶ÁÖÐÎÄÎļþà ......

Google½«ÏÞÖÆPythonÓïÑÔµÄÓ¦Óà ¿ª·¢ÉçÇøÈÈÒé

Google½«ÏÞÖÆPythonÓïÑÔµÄÓ¦Óà ¿ª·¢ÉçÇøÈÈÒé
 
¸ÐлÂ̲ÝÐÇ¿ÕµÄͶµÝ
ÐÂÎÅÀ´Ô´:CSDN
Collin WinterÊÇPythonÉçÇøһλÆľßÓ°ÏìÁ¦µÄ¿ª·¢Õߣ¬ËûÔøÊÇCPythonÏîÄ¿µÄºËÐÄ¿ª·¢ÕßÖ®Ò»¡¢Ò²ÔøÊÇUnladen Swallow£¨¼ûÎÄĩעÊÍ£©µÄºËÐÄ¿ª·¢Õߣ¬²ÎÓëÁ˺ܶàPythonÏîÄ¿µÄ¿ª·¢¡£½üÀ´´«ÎÅGoogle½«ÔÚÆäÐÂÏîÄ¿ÖÐÏÞÖÆPythonµÄʹÓã¬Îª´ËÓп ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ