from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from util.sessions import Session
class MainPage(webapp.RequestHandler):
def get(self):
session = Session()
if 'words' in session:
words = session['words']
else:
words = 'no words'
self.response.out.write('<html><body>')
self.response.out.write('<form action="/" method="post" enctype="multipart/form-data">')
self.response.out.write('Upload File: <input type="file" name="txt"><br>')
self.response.out.write('<input type="submit" name="submit" value="Submit">')
self.response.out.write(str(words))
self.response.out.write('</form>')
self.response.out.write('</body></html>')
class Study(webapp.RequestHanlder):
def post(self):
words = self.request.get('txt')
self.response.out.write(words)
application = webapp.WSGIApplication([('/', MainPage)],
('/study', Study)
], debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
2009년 12월 31일 목요일
구글 앱 엔진, 텍스트 파일 열기
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기