按类别查询搜索结果
关于关键词 的检测结果,共 346
linuxnet527 | 2013-12-30 13:18:29 | 阅读(2630) | 评论(0)
Python 3.x 连接Oracle 数据库 【1】首先下载驱动:(cx_Oracle)http://cx-oracle.sourceforge.net/http://www.python.net/crew/atuining/cx_Oracle/要注意一下版本,根据你的情况加以选择。【2】安装:执行exe安装程序就可以了,它会copy一个cx_Oracle.pyd到{PYTHON_HOME}\Lib\site-packages目录下。...【阅读全文】
utm168 | 2013-12-30 13:17:53 | 阅读(3000) | 评论(0)
Python 3.x 连接Oracle 数据库 【1】首先下载驱动:(cx_Oracle)http://cx-oracle.sourceforge.net/http://www.python.net/crew/atuining/cx_Oracle/要注意一下版本,根据你的情况加以选择。【2】安装:执行exe安装程序就可以了,它会copy一个cx_Oracle.pyd到{PYTHON_HOME}\Lib\site-packages目录下。...【阅读全文】
那片依然海 | 2013-12-21 18:37:48 | 阅读(5790) | 评论(2)
 最近增加ganglia的python模块后,发现ganglia官方源码包提供的gmond.init文件不好用了。使用的python是自己编译的,如果python是系统rpm包安装的就没有这个问题了。  比如启动gmond服务,提示成功。但ps下却没有gmond的进程。于是研究了下这个gmond.init文件。     service gmond stop  倒...【阅读全文】
gray1982 | 2013-11-20 18:42:08 | 阅读(4560) | 评论(0)
东西很简单,可扩展性很大import multiprocessingimport time,os,mathdef func(msg):    output=os.popen("ssh %s hostname" %(msg)).read()    print outputif __name__ =="__main__":    flist=open('b').readlines()    pool =multiprocessing.Pool(processes=7)...【阅读全文】
lshdcr | 2013-10-10 12:33:30 | 阅读(0) | 评论(0)
#!/usr/bin/env pythonimport commandsimport osimport random,stringimport cryptdef create_dir():    dir_list = ['logs','Gbattlefield','PHPWeb_GBattle','backup']    os.makedirs('/data/www/html/')    os.makedirs('/data/mysql_db/mysql')    ROOT = '/dat...【阅读全文】
niao5929 | 2013-09-02 10:03:07 | 阅读(700) | 评论(0)
bash中十进制和二进制的换算。【阅读全文】
nathanvorbei | 2013-09-01 15:20:00 | 阅读(5030) | 评论(2)
bash中十进制和二进制的换算。【阅读全文】
edgeman03 | 2013-08-31 16:40:30 | 阅读(4220) | 评论(0)
最近把公司的会议室公用网络网关换成了vyatta,感觉还不错,就是偶尔会出现squid3服务停止的现象,因为使用人数众多,为了性能则还是保留使用squid3,为了防止服务停止时没有处理,写了个python脚本处理下点击(此处)折叠或打开#!/usr/bin/env python#coding:utf-8...【阅读全文】
【系统运维】 07-python-mysql
lshdcr | 2013-08-27 16:32:36 | 阅读(1170) | 评论(0)
mport MySQLdbtry:        conn=MySQLdb.connect(host='localhost',port=3306,user='root',passwd='123456')        cur=conn.cursor()        cur.execute('create database if not exists ...【阅读全文】
edgeman03 | 2013-08-25 22:25:23 | 阅读(4360) | 评论(0)
前一篇已经有一篇这样的文章了,不过脚本是bash脚本,现在又用python重写了一下,主要功能还是在linux下自动更新花生壳的IP,python模块主要是用了httplib2http://blog.chinaunix.net/uid-8874157-id-3842303.html新python脚本代码如下:点击(此处)折叠或打开#!/usr/bin/env python...【阅读全文】
【系统运维】 python 邮件发送
njnajie | 2013-07-20 17:09:07 | 阅读(1150) | 评论(0)
1 简单的邮件发送 #!/usr/bin/pythonimport smtplibimport timefrom email.mime.text import MIMETextmail_content = 'test'mail_from = 'test@126.com'mail_to = ['test@qq.com']msg=MIMEText(mail_content)msg['Subject']='test mail ok'msg['From']=mail_frommsg['To']=';'.join(mail_to)smtp=smt...【阅读全文】
【系统运维】 python编写网络爬虫
MingZznet | 2013-07-13 22:31:10 | 阅读(390) | 评论(0)
【系统运维】 python编写网络爬虫
chinaboywg | 2013-07-08 13:41:37 | 阅读(1510) | 评论(0)
【系统运维】 使用python解析json文件
chinaboywg | 2013-07-08 13:30:58 | 阅读(1720) | 评论(0)
chinaboywg | 2013-07-01 01:03:46 | 阅读(3690) | 评论(0)
原来写过一个同样作用的脚本,是采用shell脚本循环expect脚本来完成批量变更交换机密码的完成任务的。具体可以看我原来的博文:http://blog.chinaunix.net/uid-8874157-id-3448298.html原脚本测试过:主要有有以下问题,1.性能问题,需要修改的交换机较多时偶尔会造成个别交换机修改密码不成功,原因未知,但单个执行脚...【阅读全文】
chinaboywg | 2013-06-30 23:40:11 | 阅读(1460) | 评论(0)
17个新手常见Python运行时错误
【阅读全文】
icucstone | 2013-06-08 17:44:16 | 阅读(2380) | 评论(1)
17个新手常见Python运行时错误
【阅读全文】
edgeman03 | 2013-05-07 21:39:38 | 阅读(4590) | 评论(0)
原来写过一个同样作用的脚本,是采用shell脚本循环expect脚本来完成批量变更交换机密码的完成任务的。具体可以看我原来的博文:http://blog.chinaunix.net/uid-8874157-id-3448298.html原脚本测试过:主要有有以下问题,1.性能问题,需要修改的交换机较多时偶尔会造成个别交换机修改密码不成功,原因未知,但单个执行脚...【阅读全文】
tjyyz | 2013-04-20 20:13:24 | 阅读(6350) | 评论(0)
点击(此处)折叠或打开# -*- coding: utf-8 -*-# change the PPPoE username & password on TP-Link Routers#import sys, urllib2, base64if __name__ == '__main__':    # IP...【阅读全文】
lzq467826892 | 2013-03-29 11:24:39 | 阅读(1900) | 评论(0)
出错现象:Traceback (most recent call last):  File "./mongo_lock", line 11, in ?    import simplejson as json  File "/usr/lib/python2.4/site-packages/simplejson-2.5.0-py2.4-linux-x86_64.egg/simplejson/__init__.py", line 112, in ?    from encoder import JSONEncoder...【阅读全文】