import web
class index:
def GET(self):
i = web.input(age=None)
return "You are " + i.age
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
This is my code. I'm testing something.
It isn't rendering the html. For example, If I return i.name by itself, and the age (i.age) parameter = <b>25</b>, it will show 5 as bolded and it renders it nicely. However, if I return return "You are " + age, the html will not render and it will just show as Hi <b>25</b>
asked Aug 26, 2014 at 14:24
user3893623
3211 gold badge5 silver badges15 bronze badges
1 Answer 1
You can use return "<html>Your are" + i.age + "</html>" as any markup entered by the user would also be considered.
answered Aug 26, 2014 at 14:49
Apoorv
3911 gold badge5 silver badges16 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py
return "<body> You are " + i.age + "</body>"?<tag>age</tag>?