-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathprogram.py
More file actions
30 lines (21 loc) · 691 Bytes
/
Copy pathprogram.py
File metadata and controls
30 lines (21 loc) · 691 Bytes
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
"""Entry point for TemperatureControl web sample."""
from __future__ import annotations
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from shared import WebForm
from temperature_control import TemperatureControl
def main() -> None:
static_dir = os.path.join(os.path.dirname(__file__), "static")
form = WebForm(title="Temperature Control", port=8080, static_dir=static_dir)
app = TemperatureControl()
app.setup(form)
print("Open http://localhost:8080 in your browser")
try:
form.start(block=True)
except KeyboardInterrupt:
pass
finally:
app.exit()
if __name__ == "__main__":
main()