在local 端不用console 執行 remote api

範例程式在此: https://developers.google.com/appengine/docs/python/tools/remoteapi

搜尋這一節:  Using the Remote API in a Local Client

但要在local 端執行要在環境變數裡面加上不少路徑, 才不會有import error

環境變數的設定方式參考:
(System Properties (=Start rightclick MyComputer Properties), Tab 
Advanced, button Environment Variables, lower box button New, Variable 
Name = PYTHONPATH, Variable value = C:\....\appengine\lib\yaml\lib, 
Restart) 

C:\Program Files (x86)\Google\google_appengine\lib\yaml\lib;C:\Program Files (x86)\Google\google_appengine;C:\Program Files (x86)\Google\google_appengine\lib\simplejson\simplejson;C:\Program Files (x86)\Google\google_appengine\lib\simplejson;C:\Program Files (x86)\Google\google_appengine\lib\fancy_urllib

畢竟這不是在remote 端執行, 要先設法搞好local 的環境
然後在範例裡面要import getpass 別忘了要import

之後就可以用 python IDEL 這種比較友善的介面(至少可以支援複製貼上) 來編輯remote api 的程式

留言

熱門文章