Time of Update: 2014-11-17
標籤:des style blog io color ar os sp for 在資料庫設計完成之後, 常常需要在 wiki
Time of Update: 2014-10-24
標籤:style blog color os ar sp 資料 div on 這即將是一篇very short very
Time of Update: 2014-10-10
標籤:os for 檔案 sp on line sql python as INSERT INTO TTT (NSAME, ID, AGE) VALUES ('AAA',
Time of Update: 2014-09-23
標籤:blog http os 使用 ar for 資料 div sp 網站就是要和資料庫進行互動,否則什麼都不用做了...今天我們來看一個叫MySQLdb的庫,這個用來和MySQL資料庫進行互
Time of Update: 2014-09-10
標籤:python cx_oracle 1.安裝python linux 內建安裝了python2.6.6 2.安裝easy_install 按照官網說明,無法安裝[[email protected] backup]# wget https://bootstrap.pypa.io/ez_setup.py -O - | python--2014-09-05 16:59:01--
Time of Update: 2014-07-12
標籤:資料庫 遊標對象 復原 提交 串連 資料庫支援python資料庫API支援sql標準的可用資料庫有很多,其中多數在python中都有對應的用戶端模組。全域變數python DB API的模組特性變數名用途apilevel所使用的python db api版本threadsafety模
Time of Update: 2014-09-13
標籤:style blog color for div 問題 sp log on 題目:猴子吃桃問題:猴子第一天摘下若干個桃子,當即吃了一半,還不癮,又多吃了一個第二天早上又將剩下的桃子吃掉一半
Time of Update: 2014-08-11
標籤:style blog http color os for 2014 ar XMLRPC伺服器端代碼,定義了三個方法名,getMonth擷取所給月份的日曆,getYear擷取一年的日曆,getDict測試返回字典的效果。xm
Time of Update: 2014-08-12
標籤:blog os 資料 for ar art div amp #encoding: utf-8__author__ = ‘Administrator‘import psycopg2import ppygisimport
Time of Update: 2014-08-13
標籤:getattr 內建函數 python中有很多的內建函數,所謂內建函數,就是在python中被自動載入的函數,任何時候都可以用。內建函數,這意味著我們不必為了使用該函數而匯入模組。不必做任何操作,Python 就可識別內建函數。在今後的學習中,不斷地去學習這些內建函數。getattr(object, name[, default])官網上對getattr()函數的說明如下:Return the value of the
Time of Update: 2014-08-13
標籤:blog color 使用 os io strong ar cti 注意1、__init__並不相當於C#中的建構函式,執行它的時候,執行個體已構造出來了。12345class A(object): &
Time of Update: 2014-08-13
標籤:windows python 編輯器 程式員 大部分視障者程式員的編碼工作都是在windows下進行的,今天我們就來說說如何在windows下搭建一個視障者可以用的python編程環境。為啥要自己搭建呢?因為內建的python編輯器IDLE (Python
Time of Update: 2018-12-08
>>> teststr = '我的eclipse不能正確的解碼gbk碼!' >>> teststr '\xe6\x88\x91\xe7\x9a\x84eclipse\xe4\xb8\x8d\xe8\x83\xbd\xe6\xad\xa3\xe7\xa1\xae\xe7\x9a\x84\xe8\xa7\xa3\xe7\xa0\x81gbk\xe7\xa0\x81\xef\xbc\x81' >>> tests2 =
Time of Update: 2018-12-08
下面就先定義一個函數: 複製代碼 代碼如下:def foo(): print('function') foo() 在上述代碼中,定義了一個名為foo的函數,這個函數沒有參數。最後一行代碼的功能是調用這個函數。這是一個函數的最簡單形式。下面來介紹一下有參數的函數: 複製代碼 代碼如下:def foo(): print('function') def foo1(a,b): print(a+b) foo()
Time of Update: 2018-12-08
文章目錄 1.open2.讀檔案3.寫檔案 1.open使用open開啟檔案後一定要記得調用檔案對象的close()方法。比如可以用try/finally語句來確保最後能關閉檔案。Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->file_object =
Time of Update: 2018-12-08
Python中初始化一個5 x 3每項為0的數組,最好方法是:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->multilist = [[0 for col in range(5)] for row in range(3)]我們知道,為了初始化一個一維數組,我們可以這樣做:Code highlighting produced by Actipro
Time of Update: 2018-12-08
文章目錄 一、函數定義二、函數傳回值三、函數參數 一、函數定義我們可以比較容易定義一個函數,比如之前談過的列印Fibonacci序列,可見下面例子def fib(n): a, b = 0, 1 while b < n: print b, a, b = b, a + b# now call the
Time of Update: 2014-10-23
python Debug 單步調試,pythondebug一直犯愁的是python的調試,以前寫c都是編譯完了用gdb直接調試了,輕鬆愉快。現在遇到這麼一個解釋型的程式,不知道怎麼辦了。用log吧,有時就是一個小程式,不想寫這麼多代碼;打屏吧,有時螢幕翻得快,也是挺鬱悶的。今天終於好了,看到了一個有用的東西,PDB方法一:運行 python -m pdb myscript.py(Pdb) 會自動停在第一行,等待調試,這時你可以看看 協助(Pdb) h說明下這幾個關鍵
Time of Update: 2014-05-07
1.字串轉換s.lower() 轉為小寫s.upper() 轉為大寫s.swapcase() 大寫轉為小寫,小寫轉為大寫s.capitalize() 首字母大寫轉換為int類型 string.atoi(s) 或者int(s)轉換為float類型 string.atof(s) 或者float(s)轉換為long類型 string.atol(s) 或者long(s)2.尋找等操作s.find(sub,[,start[,end]]) 返回首次出現的位置,找不到返回-1s.
Time of Update: 2013-12-27
使用Python大量刪除檔案清單環境:已知要刪除的檔案清單,即確定哪些檔案要刪除。代碼如下:#!/usr/bin/env python#coding=utf-8#目的:本程式主要為刪除給定的檔案清單import osimport shutil#引入模組,os為包含普