Project 8
Folder Structure
final_project/
β
βββ static/
β βββ style.css
β
βββ app.pyfinal_project/ $ flask runapp.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def room1():
return """
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<title>Welcome to PCTI!</title>
</head>
<body>
<h1>Welcome to PCTI!</h1>
<img width="128" alt="Titlenew" src="https://upload.wikimedia.org/wikipedia/commons/7/7e/Titlenew.jpg?20120113163901">
<p>You are in a dark hallway in the D Wing.</p>
<LI><a href="/d202">Enter D202</a>
<LI><a href="/d203">Enter D203</a>
</body>
</html>
"""
@app.route('/d202')
def d202():
return """
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<title>Room 2</title>
</head>
<body>
<h1>D202</h1>
<p>You see Winsel but there is something wrong with him...</p>
<p>He's not talking about Lebron..</p>
</body>
</html>
"""
@app.route('/d203')
def d203():
return """
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<title>D203</title>
</head>
<body>
<h1>Room 2</h1>
<p>You see Brandon but there is something wrong with him...</p>
<p>He seems more energetic than usual..</p>
<p>Tahmid lurks in the background... waiting...</p>
</body>
</html>
"""
if __name__ == '__main__':
app.run(debug=True)static/style.css
Last updated