omg it works
This commit is contained in:
commit
2aa6c7899b
15
.vscode/launch.json
vendored
Normal file
15
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Python: Current File",
|
||||||
|
"type": "python",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${file}",
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
BIN
__pycache__/bottle.cpython-38.pyc
Normal file
BIN
__pycache__/bottle.cpython-38.pyc
Normal file
Binary file not shown.
15
index.py
Normal file
15
index.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
url_path = "http://192.168.100.50:5000"
|
||||||
|
|
||||||
|
from bottle import run, route, request, template,get ,post
|
||||||
|
import urllib.request, json
|
||||||
|
|
||||||
|
@route('/')
|
||||||
|
def index():
|
||||||
|
contents = json.loads(urllib.request.urlopen(url_path).read().decode())
|
||||||
|
return template('index', name=contents)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
run(host='0.0.0.0', port=5000, debug=True, reloader=True)
|
11
views/index.tpl
Normal file
11
views/index.tpl
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<h1>
|
||||||
|
{{name}}
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
|
||||||
|
%for i in name:
|
||||||
|
<li>
|
||||||
|
{{i['name']}}, state:
|
||||||
|
{{i['state']}}
|
||||||
|
</li>
|
||||||
|
%end
|
Loading…
Reference in New Issue
Block a user