Displaying Real-Time Messages
To provide real-time feedback to users, use thew_text_output widget in combination with the submit_widget_state() function. This approach ensures that messages appear dynamically as the process runs.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Learn how to display real-time messages as the cell runs.
w_text_output widget in combination with the submit_widget_state() function. This approach ensures that messages appear dynamically as the process runs.
from lplots.widgets.text import w_text_output
from lplots import submit_widget_state
import time
def run_long_process():
# Display initial message
w_text_output(content="Starting long-running process...", appearance={"message_box": "info"})
submit_widget_state()
# Simulate first long task
time.sleep(2)
w_text_output(content="Step 1 complete: Data preprocessing finished...", appearance={"message_box": "warning"})
submit_widget_state()
# Simulate second long task
time.sleep(2)
w_text_output(content="Step 2 complete: Model training finished...", appearance={"message_box": "warning"})
submit_widget_state()
# Simulate final task
time.sleep(2)
w_text_output(content="✅ All processing complete!", appearance={"message_box": "success"})
submit_widget_state()
# Run the example
run_long_process()
Was this page helpful?