> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.latch.bio/llms.txt
> Use this file to discover all available pages before exploring further.

# Messages

> Learn how to display real-time messages as the cell runs.

This guide explains how to display progress messages in real-time when running long computations in a notebook. When a notebook is in non-developer mode, displaying messages helps keep end users informed about ongoing processes.

## Displaying Real-Time Messages

To provide real-time feedback to users, use the `w_text_output widget` in combination with the `submit_widget_state()` function. This approach ensures that messages appear dynamically as the process runs.

### Example

```python theme={null}
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()
```

What it looks like:

<video autoPlay muted loop playsInline className="w-full aspect-video" class="rounded-md">
  <source src="https://mintcdn.com/latchbio/rZf7ybfryGn4thLo/images/plots/developer/logs.mp4?fit=max&auto=format&n=rZf7ybfryGn4thLo&q=85&s=6695887584de32f08edcb3110b54563e" data-path="images/plots/developer/logs.mp4" />
</video>
