-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolution.py
More file actions
54 lines (41 loc) · 2.1 KB
/
Copy pathsolution.py
File metadata and controls
54 lines (41 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from flask import Flask, url_for
app = Flask(__name__)
@app.route('/')
def index():
return 'Миссия Колонизации Марса'
@app.route('/index')
def main():
return 'И на Марсе будут яюлони цвести!'
@app.route('/promotion')
def promotion():
text = ['Человечество вырастает из детства.',
'Человечеству мала одна планета.',
'Мы сделаем обитаемыми безжизненные пока планеты.',
'И начнем с Марса!',
'Присоединяйся!']
return '</br>'.join(text)
@app.route('/image_mars.')
def image_mars():
return f'''<!DOCTYPE html>
<head> <title>Привет, Марс!</title>
</head>
<body><h1>Жди нас, Марс!</h1></br>
<img src="{url_for('static', filename='img/MARS.png')}"/>
<p>Вот она какая, красная планета</p>
</body>'''
@app.route('/promotion_image')
def promotion_image():
text = ['<p style="background-color: grey">Человечество вырастает из детства.</p>',
'<p style="background-color: green">Человечеству мала одна планета.</p>',
'<p style="background-color: grey">Мы сделаем обитаемыми безжизненные пока планеты.</p>',
'<p style="background-color: yellow">И начнем с Марса!</p>',
'<p style="background-color: red">Присоединяйся!</p>']
return f'''<!DOCTYPE html>
<head> <title>Колонизация</title>
</head>
<body><h1 style="color:red">Жди нас, Марс!</h1></br>
<img src="{url_for('static', filename='img/MARS.png')}"/>
<p>Вот она какая, красная планета</p>
{''.join(text)}
</body>'''
app.run(host='127.0.0.1', port=8080)