question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[help] How to print text in between `[` and `]`

See original GitHub issue

When I try to print any text in between [ and ]` it is not printed.

For example, print("[in]") prints an empty line. How could I prevent this from happening?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
avatar-lavventuracommented, Oct 7, 2021

I think I got it after multiple of tries:

from rich.markup import escape

a = 100 # or "hello"
var = escape(f"[{a}]")
print(f"{var} hello")
0reactions
willmcgugancommented, Oct 7, 2021

Yes, it’s because markup styles must start with a letter. The rational is that it allows you to print a list without it being interpreted as markup. One of the reasons it is best to use rich.markup.escape which is aware of this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

regex - Print Text Between "<" and ">" in awk - Stack Overflow
Given a regex, it performs a substitution (by default, operating on the whole line, $0 ), and returns the modified string.
Read more >
Print text between (and including) two delimiters on a line
What's the best way to print the text between (and including) the first pattern ("SELECT" or "SSELECT") and a second pattern ("[") using...
Read more >
How to Print Text Messages for Court - Android and iPhone
1. Open Decipher TextMessage, select your phone. 2. Choose a contact with text messages you need to print for court. 3. Select Export....
Read more >
Print Lines Between Two Patterns in Linux - Baeldung
When we work in the Linux command-line, we can do common line-based text searches by a handy utility: the grep command.
Read more >
Printing text between line numbers or patterns
To print the lines of a text in a range of line numbers, M to N , use the following syntax: $ awk...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found