質問編集履歴

1

プログラムコードを修正しました。ご指摘ありがとうございます。

2017/07/17 04:51

投稿

hanpanai-tumi
hanpanai-tumi

スコア26

test CHANGED
File without changes
test CHANGED
@@ -100,13 +100,11 @@
100
100
 
101
101
  buf=reader.read()
102
102
 
103
- # print(buf)
103
+ print(buf)
104
104
 
105
105
  buf = buf.decode('sjis',"ignore")
106
106
 
107
- # print(buf)
108
-
109
- root = ET.fromstring(buf)
107
+ root = ET.fromstring(buf)
110
108
 
111
109
  Res=[]
112
110
 
@@ -130,7 +128,7 @@
130
128
 
131
129
  Res.append(suggest)
132
130
 
133
- #print (Res)
131
+ print (Res)
134
132
 
135
133
  return Res
136
134
 
@@ -166,10 +164,6 @@
166
164
 
167
165
 
168
166
 
169
- #@get("/login")
170
-
171
- #def echo():
172
-
173
167
  B = []
174
168
 
175
169
  if '__main__' == __name__:
@@ -186,21 +180,11 @@
186
180
 
187
181
  for result in result_list:
188
182
 
189
- # result = result.decode('utf-8')
190
-
191
- B.append(result + '<br>')
183
+ B.append(result + '<br>')
192
-
193
- #B.append('\n')
184
+
194
-
195
- return ( hp + "".join(B) )
185
+ return ( hp + "".join(B) )
196
-
197
- # time.sleep(1)
186
+
198
-
199
- # return(food)
187
+
200
-
201
-
202
-
203
-
204
188
 
205
189
 
206
190
 
@@ -208,15 +192,11 @@
208
192
 
209
193
  def do_login():
210
194
 
211
- # username = request.forms.get("username")
212
-
213
- # dish = request.forms.get("dish")
214
-
215
195
  dish = request.forms.decode().get( 'dish' )
216
196
 
217
197
  if check_login(dish):
218
198
 
219
- #response.set_cookie("account", dish)
199
+
220
200
 
221
201
  return "<p>正解です !</p>"
222
202
 
@@ -230,11 +210,7 @@
230
210
 
231
211
  def check_login(dish):
232
212
 
233
- #dish = request.forms.get("dish")
234
-
235
- #print (dish.encode('utf-8'))
236
-
237
- if (food.encode('utf-8')) == (dish.encode('utf-8')):
213
+ if (food.encode('utf-8')) == (dish.encode('utf-8')):
238
214
 
239
215
  return True
240
216
 
@@ -262,7 +238,11 @@
262
238
 
263
239
 
264
240
 
241
+
242
+
243
+
244
+
265
- hello_template.tpl
245
+ #hello_template.tpl
266
246
 
267
247
  <img src="{{url('static_file', filepath="image.jpg")}}">
268
248