Re:Show HN: PyWebIO – Write interactive web app in script way
by bernardv on Tuesday March 23, 2021 @12:36PM
(#26556984)
This is great. Does it rely on web sockets?
[ Parent
| on HN ]
Re:Show HN: PyWebIO – Write interactive web app in script way
by lovasoa on Tuesday March 23, 2021 @01:05PM
(#26557328)
Looking at it from the web inspector, yes, it's entirely over websockets, sending json messages :
{"event":"input_event","task_id":"main-140213579376912","data":{"event_name":"blur","name":"weight","value":"21"}}
{"command": "output", "spec": {"type": "markdown", "content": "Your BMI: `1458.3`, Category: `Severely obese`", "sanitize": true, "scope": "#pywebio-scope-ROOT", "position": -1}, "task_id": "main-140213579376912"}
Re:Show HN: PyWebIO – Write interactive web app in script way
by crazypython on Tuesday March 23, 2021 @12:55PM
(#26557210)
It seems to stream the HTML over the original HTTP socket– web browsers can render incomplete streams of HTML.
Re:Show HN: PyWebIO – Write interactive web app in script way
by Wang0618 on Tuesday March 23, 2021 @10:32PM
(#26562895)
Both http and websocket protocol can be used to implement server-browser communication in PyWebIO. The websocket is default, and you can use `pywebio.platform.tornado_http.start_server()` or `pywebio.platform.path_deploy_http()` to use http polling to communicate.