python
chsboy
这个作者很懒,什么都没留下…
展开
-
python的socket连接·
python的socket连接很简单:[code="java"]import socketbuffer= '01300000120090526101010000's = socket.socket(socket.AF_INET, socket.SOCK_STREAM)s.connect(('10.25.76.117',8088))import timefor i...原创 2010-08-24 16:56:49 · 135 阅读 · 0 评论 -
python定时删除日志
用python脚本定时删除主机上的日志非常方便:[code="java"]import osimport timewhile(1): os.chdir("/dev/dev/log") os.system("rm * ") time.sleep(1800)[/code]...原创 2010-08-30 13:13:31 · 501 阅读 · 0 评论 -
python输出网页内容
from urllib import urlopendoc = urlopen("http://www.sina.com.cn").read( )print doc原创 2010-08-31 09:56:53 · 730 阅读 · 0 评论 -
python的string
import stringtext = "Monty Python's Flying Circus"print "upper", "=>", string.upper(text)print "lower", "=>", string.lower(text)print "split", "=>", string.split(tex原创 2010-08-31 09:58:21 · 99 阅读 · 0 评论 -
python打开网页
import webbrowserimport timewebbrowser.open("http://www.sina.com.cn")# wait a while, and then go to another pagetime.sleep(5)webbrowser.open( "http://www.163.com" )原创 2010-08-31 10:08:12 · 242 阅读 · 0 评论 -
python操作oracle数据库
这里用到了dcoracle2模块:[code="java"]import DCOracle2import timedb=DCOracle2.connect("dev/dev@test")cursor=db.cursor()while(1): cursor.execute("select * from test") d=cursor.fetchone() ...原创 2010-09-02 16:18:34 · 132 阅读 · 0 评论 -
在HP-UX下编译Python和cx_Oracle(转)
在HP-UX下编译Python和cx_Oracle(转)===========================================================作者: rainrhb(http://rainrhb.itpub.net)发表于: 2006.08.22 22:17分类: Oracle出处: http://rainrhb.itpub.net/post/2...原创 2010-09-02 16:34:02 · 223 阅读 · 0 评论