Skip to content
Discussion options

You must be logged in to vote

Hello! This is a great opportunity to try out the new "asynx" syntax for long callbacks which was made available in Taipy 4.1:

import time

import taipy.gui.builder as tgb
from taipy.gui import Gui, State

calculus_progress = 0


async def start_progress(state: State):
    for i in range(11):
        state.calculus_progress = 10 * i
        time.sleep(1)


with tgb.Page() as page:
    tgb.progress("{calculus_progress}", show_value=True, title="Calculus Progress")
    tgb.button("Start", on_action=start_progress)

if __name__ == "__main__":
    pages = {"/": page}
    gui = Gui(pages=pages)

    # This will make the "calculus_progress" value be shared with all connected sessions/browsers
    

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JaniKallankari
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants