Last active
May 24, 2018 10:32
-
-
Save vihar/370d1ebb10fc4c2999a7553164d669e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/greet') | |
def greet(): | |
user = {'username': 'John', 'age': "20"} | |
return ''' | |
<html> | |
<head> | |
<title>Templating</title> | |
</head> | |
<body> | |
<h1>Hello, ''' + user['username'] + '''!, you’re ''' + user['age'] + ''' years old.</h1> | |
</body> | |
</html>''' | |
if __name__ == '__main__': | |
app.run(debug = True,port=8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment