File tree Expand file tree Collapse file tree 2 files changed +31
-7
lines changed
appengine/standard_python3/cloud_debugger Expand file tree Collapse file tree 2 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 16
16
# [START gae_python3_app]
17
17
import logging
18
18
19
- from flask import Flask , request
19
+ from flask import Flask , render_template , request
20
20
21
21
# Enable cloud debugger
22
22
try :
@@ -67,12 +67,7 @@ def ReverseString():
67
67
68
68
current = StringProcessor (s ).Reverse ()
69
69
expected = s [::- 1 ]
70
- return '''
71
- <table>
72
- <tr><th>Program Output:</th><th>{}</th></tr>
73
- <tr><th>Correct Output:</th><th>{}</th><tr>
74
- </table>
75
- ''' .format (current , expected )
70
+ return render_template ("index.html" , current = current , expected = expected )
76
71
77
72
78
73
@app .route ('/' )
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ <!--
3
+ Copyright 2022 Google LLC
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ -->
17
+
18
+ < html >
19
+ < head >
20
+ < title > Reverse a String</ title >
21
+ </ head >
22
+
23
+ < body >
24
+ < table >
25
+ < tr > < th > Program Output:</ th > < th > {{ current }}</ th > </ tr >
26
+ < tr > < th > Correct Output:</ th > < th > {{ expected }}</ th > < tr >
27
+ </ table >
28
+ </ body >
29
+ </ html >
You can’t perform that action at this time.
0 commit comments