Recent submissions

Comment · 4 years ago
Comment · 5 years ago
Awesome work! I also developed a similar project called PyWebIO (https://github.com/pywebio/PyWebIO) last year. It provides less control to HTML element but provides a straightforward way to make input and output. Hope we can learn from each other's project.
Comment · 5 years ago
You can place a password validation input at the beginning of the code and return directly if the validation does not pass. PyWebIO ensures that only users who have passed the validation can continue with the rest of the code.
Comment · 5 years ago
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.
Comment · 5 years ago
PyWebIO won't re-execute the whole script. In pywebio, if the code executes to the end, the user session will also be closed. You can use `while` loop in your code to continuously receive user input in PyWebIO app.

PyWebIO now support defining inputs based on other ones, but I haven't written this feature into the documentation. Until then, you can solve this problem by splitting inputs with dependencies into multiple forms. (you can use first form to get company and then use another form to get employee)

Comment · 5 years ago
You can check this section first: https://pywebio.readthedocs.io/en/latest/guide.html#server-m...

More details about deployment will be added to the documentation later.

Comment · 5 years ago
PyWebIO is more lightweight and supports coroutine and web framework integration.

Although PyWebIO is indeed a bit crude, the usage scenarios of PyWebIO and streamlit don't exactly overlap.

Comment · 5 years ago
Streamlit uses a responsive way to get input and doesn't rely on callbacks at all. Every time a user interacts with a widget, your script is re-executed and the output value of that widget is set to the new value during that run. It's amazing but also a little hard to understand.

In contrast, the way of writing PyWebIO app is more like writing a terminal program, except that the terminal here becomes a browser. The output functions will output content to user in real time, and the input functions will block until the user submit the input form.

Comment · 5 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton