GAE 筆記


1
2
3
4
5
6
7
8
9
10
11
12
13
#Python 中一些函式 , PHP 是 trim
strip #同時去除左右兩邊的空格
lstrip #去除左邊的空格
rstrip #去除右邊的空格

#Python 中的 Substr 也是比較特別,相對於 PHP 函式
s = "This is a test"
x = s[5:6] #x = "is"
x = s[:4] #x = "This"
x = s[10:] #x = "test"
x = s[4:-2] #x = "te"
len(x) # 這是計長度
x.replace("is", "are") # 這是取代, 感覺不完全 OO ?有別於 Ruby?

上面的詳細資料可參考
http://www.astro.ufl.edu/~warner/prog/python.html

Perl Python C/C++ 語法可參考
http://www.strombergers.com/python/

還有 Python 的 Doc, 這頁是 File 檔案的處理
http://docs.python.org/lib/bltin-file-objects.html

關於 GAE 的進一步資料.不玩真的不了解 = =.
所以目前原打算用 Python 重寫的 Whois 查詢 Socket 部份改掉了
換為了連到我的伺服器再叫調 PHP 的 socket 查詢後回傳資料..
慢了很多很多..天丫..= =

程式 : http://ucode.appspot.com/
如果 : 查 xx.hk 這類的還算快..但查 .com 這類慢得很..或查不到(只怪不支援 Socket ,限制了連接端口)

  1. socket 不能用.
  2. 不能含 C extension.
  3. 支援 Django、WebOb、PyYAML.
  4. thread 不能用.
  5. sub process 不能用.