Time of Update: 2015-01-19
標籤:一、Linux下安裝1.yum install -y git2.安裝pip,參考:https://app.yinxiang.com/shard/s41/sh/0338ba85-5443-453f-b8c1-349a70377e73/7b712e4a6718279862eae0b71de43697 3.git clone https://github.com/influxdb/influxdb-python.gitcd influxdb-pythonpip install -r
Time of Update: 2014-12-19
標籤:每天學習一點點,C#寫膩了,最近在寫NODE,PYTHON,SWIFT,豐富自己的開發世界;python更多的是作為膠水語言,做一些自動化的指令碼,網路任務,資料庫任務,定時任務;安裝MysqlDB要想使python可以操作mysql 就需要MySQL-python驅動,它是python 操作mysql必不可少的模組。:https://pypi.python.org/pypi/MySQL-python/>>python setup.py
Time of Update: 2014-12-10
標籤:使用 sp for on 檔案 資料 問題 bs 代碼 今天時間不多了,只能寫一部分了。 Python串連Pgsql的庫有三個,目前 psycopg2
Time of Update: 2014-11-06
標籤:blog io ar 使用 for 資料 on 2014 log Sample1# coding=gbkfrom sqlalchemy import *from
Time of Update: 2014-10-18
標籤:des style blog color io os ar for sp 1 import MySQLdb 2 import xlwt 3 def outMySQL(file_name)
Time of Update: 2015-03-16
標籤:leetcode python Write a function that takes an unsigned integer and returns the number of ’1‘ bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11‘ has binary
Time of Update: 2015-03-15
標籤:#標準庫:StringIO提供類檔案API文本緩衝區#作用:可以處理記憶體中的文本,有2種不同的實現:cStringIP版本用c編寫提高速度,StringIO用python來提供可移植性,與其他字串串連相比,cStringIO構造大字串提供了更好的效能#樣本try: from cStringIO import StringIOexcept: from &nbs
Time of Update: 2015-03-16
標籤:python 異常 python異常處理機制和java類似,採用try-except-finally的結構.try-except檢測異常格式try: try_statementexcept (ErrorType1, ErrorType2),e: handle_statementfinally: finally_statement執行個體#!/usr/bin/pythontry: a=12 b=
Time of Update: 2015-03-16
標籤:python 學習解決:函數調用賦值順序的問題01,一般情況下是一一對應賦值(有預定義值的可以不賦值)-------推薦******02,可以指定形參一一賦值03,有預定義值的參數不能優先於無預定義值的參數被賦值註:01的情況下在調用的時候,不用寫形參名稱。 02的情況下在調用的時候,需指定:形參名稱=值(所有形參全部指出)eg1:def test_e(n1,n2,n3=15):
Time of Update: 2015-03-13
標籤:安裝 Linux Linux已經內建Python了,我的Centos7內建Python2.7.4,我通過源碼安裝來更新版本。 <!--lang: sh-->#!/bin/bash#源碼安裝wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgztar -zxvf Python-2.7.9.tgzcd Python-2.7.9#編譯安裝./configuremakemake install
Time of Update: 2015-03-14
標籤:搬運自http://www.2cto.com/kf/201309/242273.html,感謝原作。之所以出現上面的異常,是因為如果用 urllib.request.urlopen
Time of Update: 2015-03-12
標籤:paramiko time sys os traceback commands #!/usr/bin/env python#-*-coding:UTF-8-*-"""@Item : v1.0@Author :&nb
Time of Update: 2015-03-12
標籤:python之分解多列表嵌套針對多列表嵌套,如何擷取所有元素?之前使用for迴圈+if判斷,進行分解,如下: for first_layer in lists: if isinstance(first_layer,list): for
Time of Update: 2015-03-12
標籤:Welcome¶Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently. Theano features:tight integration with NumPy – Use numpy.ndarray in
Time of Update: 2015-03-11
標籤: 1 import os 2 import sys 3 4 def find_file(root_dir, type): 5 dirs_pool = [root_dir] 6 dest_pool = [] 7 8 def scan_dir(directory): 9 entries = os.walk(directory)10 for root, dirs, files in entries:11
Time of Update: 2015-03-11
標籤:1:整形#十進位1 >>> print 12 13 >>> print -14 -15 >>> print 06 07 >>>1 >>> #16進位以0x開頭,0-9,a-f,A-F2 ...3 >>> print 0xa4 105 >>> print 0xA6 107 >>>1 >>> #2進位以0b開頭,0和12 ...3 &
Time of Update: 2015-03-12
標籤:python jsessionid 在使用Python對一些網站的資料進行採集時,經常會遇到需要登入的情況。這些情況下,使用FireFox等瀏覽器登入時,內建的調試器(快速鍵F12)就可以看到登入的時候網頁向伺服器提交的資訊,把這部分資訊提取出來就可以利用Python 的 urllib2
Time of Update: 2015-02-10
標籤:思路:利用ruquest發送請求,利用多線程類比並發下面直接上代碼:#!/user/bin/env python#coding=utf-8import requestsimport datetimeimport timeimport threadingclass url_request(): times = [] error = [] def req(self,AppID,url): myreq=url_request() headers =
Time of Update: 2015-01-19
標籤:【概覽】本文實現如下的程式:(在表單中繪畫出[-100, 100]兩個周期的正弦函數映像) 主要步驟如下:1、在eric6中建立項目,建立表單2、(自動開啟)進入PyQt5 Desinger,編輯圖形介面,儲存3、回到eric 6,對上一步得到的介面檔案 drawing.ui 檔案右擊,編譯表單,得到 Ui_drawing.py 檔案4、然後再對 drawing.ui 檔案右擊,產生對話方塊代碼,得到 drawing.py 檔案。(在drawing.py中添加自己的程式邏輯)5、
Time of Update: 2014-11-29
標籤:style blog http io ar color os 使用 sp 最近比較忙,