少年阿賓

          那些青春的歲月

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks
          import MySQLdb
          import time
          try:
              conn=MySQLdb.connect(host='localhost',user='root',passwd='',db='abin',port=3306)
              cur=conn.cursor()
              result=cur.execute('select * from tabin')
              print result
              print '-------'
              info=cur.fetchmany(result)
              for ii in info:
                  currentTime = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
                  values=[ii[1],currentTime]
                  cur.execute('insert into sabin (name,create_time) values (%s,%s)',values)
                  print '===='
              cur.close()
              conn.commit()
              conn.close()
          except MySQLdb.Error,e:
              print "Mysql Error %d: %s % ()e.args[0],e.args[1]"



          import urllib
          params = urllib.urlencode({'type':'mobile','parameter':'13521502037','pageNum':1,'pageSize':10})
          conn = urllib.urlopen("http://test.qunar.com:7400/complaints/find.action",params);
          result = conn.read()
          print result
          posted on 2015-01-28 11:57 abin 閱讀(425) 評論(0)  編輯  收藏 所屬分類: python

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 炎陵县| 永吉县| 高平市| 玛沁县| 聊城市| 吴桥县| 和政县| 青岛市| 固始县| 肥东县| 平果县| 仪陇县| 屏东市| 巴彦淖尔市| 宜阳县| 巫溪县| 武定县| 夏津县| 苍山县| 大田县| 沁阳市| 尚义县| 县级市| 仪陇县| 临江市| 岚皋县| 新民市| 吉木萨尔县| 密云县| 天门市| 高碑店市| 陆丰市| 紫阳县| 海林市| 招远市| 炎陵县| 桃源县| 常宁市| 同仁县| 新源县| 阜城县|