omg it works

This commit is contained in:
lulzette 2021-03-25 19:53:50 +00:00
commit 2aa6c7899b
6 changed files with 4466 additions and 0 deletions

15
.vscode/launch.json vendored Normal file
View 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"
}
]
}

0
README.md Normal file
View File

Binary file not shown.

4425
bottle.py Normal file

File diff suppressed because it is too large Load Diff

15
index.py Normal file
View 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
View File

@ -0,0 +1,11 @@
<h1>
{{name}}
</h1>
%for i in name:
<li>
{{i['name']}}, state:
{{i['state']}}
</li>
%end