Skip to content

How to get styled string? #1458

Discussion options

You must be logged in to vote

I found a way

def convert_to_str(e):
    with console.capture() as capture:
        console.print(str(e), highlight=False)
    str_out = capture.get()
    return str_out

Replies: 1 comment

Comment options

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