import webapp2
import jinja2
import os
template_env = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.getcwd()))
class InputPage(webapp2.RequestHandler):
def get(self):
#self.reponse.out.write('asdf')
template = str(template_env.get_template('input.html'))
context = {
'abc':1,
}
self.response.out.write(template.render(context))
def post(self):
try:
text_input = str(self.request.get('input_textarea')) ####
template = template_env.get_template('input.html')
context = {
'input_text':text_input,
}
self.response.out.write(template.render(context))
except ValueError:
pass
application = webapp2.WSGIApplication([('/input',InputPage)],debug=True)
๊ธฐ๋ณธ์์ ์ค์ #### (19๋ฒ์งธ ์ค)์์ ์งํ์ด ์๋๊ธธ๋, str() ํจ์๋ ๋ถ๋ช ๋ฌธ์ ๊ฐ ์๋๋ฐ ๋ง์ด๋ค.
ํฐ๋ฏธ๋๋ก ๋ค์ด๊ฐ์ ํ ์คํธ๋ฅผ ํ๋ค๋ณด๋ 2~3๋ฒ ์ปค๋งจ๋๋ฅผ ์ ๋ ฅํ๋ฉด ๋ฐ์ํ๋ ์๋ฌ Segmentation fault: 11
๊ตฌ๊ธ๋ง์ ํ๋, ๊ฝค ํํ ์๋ฌ๋๋ผ.
ํด๊ฒฐ๋ฐฉ๋ฒ์ ๋ค์๊ณผ ๊ฐ๋ค.
cd /Library/Frameworks/Python.framework/Versions/3.3 cd ./lib/python3.3/lib-dynload sudo mv readline.so readline.so.disabled
2.7๋ฒ์ ์ ์ฐ๋ ์ฌ๋์ 3.3๋์ 2.7๋ก ๋ฐ๊ฟ์ ํ๋ฉด ๋๋ค.