我正在嘗試使用Google App Engine製作一個簡單的應用程序。配置腳本處理程序Google App Engine
下面是我的代碼
helloworld.py
print "hello"
class helloworld():
def myfunc(self):
st = "inside class"
return st
test.py
import helloworld
hw_object = helloworld.helloworld()
print hw_object.myfunc()
app.yaml
handlers:
- url: /.*
script: helloworld.py
- url: /.*
script: test.py
當我るñ我的申請通過http://localhost:10000
它只打印hello
而我的預期輸出是hello
和inside class
。
我的目錄結構
E:\helloworld>dir
app.yaml helloworld.py test.py
我敢肯定這事做與Script Handlers。所以,什麼是定義處理的,什麼是錯誤的,我定義它們的方式的正確方法。
你的意思是有兩個相同的路徑正則表達式? – bernie 2012-02-21 05:54:05
我的意思是,如果我的文件夾中有多個腳本,我該如何配置我的'app.yaml'。我試過上述模式,它沒有工作。我需要的是如果我運行'localhost:10000'我的腳本應該是執行,但沒有發生。 – RanRag 2012-02-21 05:55:27
@AdamBernier:我想'網址:/測試/.*'但仍沒有運氣。 – RanRag 2012-02-21 06:10:22