1
我想讀從Python中的INI文件,和我下面的腳本上來:的urllib錯誤500個本地工作
import webapp2
import urllib
import ConfigParser
class MainPage(webapp2.RequestHandler):
def get(self):
getstreet = self.request.get('street')
getlocation = self.request.get('location')
self.response.headers['Content-Type'] = 'text/plain'
map = ConfigParser.RawConfigParser()
map.read('Map.ini')
coords = map.get(getlocation, getstreet)
self.response.out.write(coords)
app = webapp2.WSGIApplication([('/map', MainPage)],
debug=True)
從外面我只需要閱讀:
xxx.appspot.com/地圖位置= mylocation &街道= mystreet
我仔細檢查了該INI文件上傳和可用:
xxx.appspot.com/Map.ini
它本地工作得很好,但在部署時,我得到一個錯誤。
我見過提到url提取,但我可以找到的所有例子都是相反的
任何想法?
更多信息,沒錯它工作的感謝!我之前並沒有真正明白這一點,無論如何,它出現在代碼中時都會被上傳。完全刪除它從app.yaml:] – lemo 2012-07-05 10:44:18
@ user1503382隨時upvote並接受答案:) – 2012-07-05 11:29:49