Skip to content
Discussion options

You must be logged in to vote

Often, if you can't get something to work, it can be a good idea to show what you tried and say how it failed so we can help correct any misunderstanding.

To start with, here's an example of an application that logs the time every second, capturing a print to do it:

from datetime import datetime

from textual.app import App, ComposeResult
from textual.events import Print
from textual.widgets import Log

class PrintLog(Log):

    def on_mount(self) -> None:
        self.begin_capture_print()

    def on_print(self, event: Print) -> None:
        self.write(event.text)

class PrintLogApp(App[None]):

    def compose(self) -> ComposeResult:
        yield PrintLog()

    def print_time(self) -> 

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wjh-97
Comment options

@davep
Comment options

Answer selected by davep
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