12 2012 档案

Python中MySQLdb的各种常见用法
摘要:Python代码#-*-coding:utf-8-*-#mysqldbimporttime,MySQLdb#连接conn=MySQLdb.connect(host="localhost",user="root",passwd="",db="test",charset="utf8")cursor=conn.cursor()#写入sql="insertintouser(name,created)values(%s,%s)"param=("aaa",int(ti 阅读全文

posted @ 2012-12-24 16:17 linzuxin 阅读(380) 评论(0) 推荐(0)

Python中urllib2总结
摘要:使用Python访问网页主要有三种方式: urllib, urllib2, httpliburllib比较简单,功能相对也比较弱,httplib简单强大,但好像不支持session1. 最简单的页面访问res=urllib2.urlopen(url)print res.read()2. 加上要get或post的数据data={"name":"hank", "passwd":"hjz"}urllib2.urlopen(url, urllib.urlencode(data))3. 加上http头header={&quo 阅读全文

posted @ 2012-12-24 10:35 linzuxin 阅读(266) 评论(0) 推荐(0)

rabbitmq 3.0.1安装
摘要:1.python版本必须2.6以上。安装python 2.7.32. 安装python json:wget -q http://peak.telecommunity.com/dist/ez_setup.pypython ez_setup.pyeasy_install simplejson3. 安装jdk:4. 安装xmlto:yum -y install xmlto5. 安装erlang:tar zxvf otp_src_R15B01.tar.gzcd otp_src_R15B01./configuremakemake install6. 安装rabbitmq-server-3.0.1.tar 阅读全文

posted @ 2012-12-14 10:59 linzuxin 阅读(406) 评论(0) 推荐(0)

导航