PyWebIO icon indicating copy to clipboard operation
PyWebIO copied to clipboard

how to restart the pywebio script with a Button?

Open Fatalerr opened this issue 2 years ago • 2 comments

Hi Wang, Thank you for creating such an awesome project!

I'd like to add a button at the end of the pywebio script, then the user can click the button and restart the app. I had searched the doc but found nothing about this feature. could you give me a hint? thanks again.

Fatalerr avatar Apr 10 '22 14:04 Fatalerr

Just wrap your script code with a function, and use the following code to start your script:

while True:
    app()
    act = actions(buttons=["Restar", "Exit"])
    if act=="Exit":
        break

wang0618 avatar Apr 12 '22 12:04 wang0618

thanks! will have a try.

Fatalerr avatar Apr 13 '22 15:04 Fatalerr