Textualize / rich

Rich is a Python library for rich text and beautiful formatting in the terminal.
https://rich.readthedocs.io/en/latest/
MIT License
49.05k stars 1.71k forks source link

Is there a way to print the line number while console.log'ging a single line? #3284

Closed carbon-starlight closed 7 months ago

carbon-starlight commented 7 months ago

I was recommended rich's console.log() as a way to add to a print statement output the number of the line of the print statement itself. With console.log(some_array) the number of it's line is indeed being printed — after a column next to filename. But when I console.log() a single string there is no line number being printed. Is there a way to print one?

github-actions[bot] commented 7 months ago

We found the following entries in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

carbon-starlight commented 7 months ago

Never mind, it looks like my VSCode terminal wasn't displaying the whole lines for some reason. There are line numbers when printing single strings at the end of the lines, the terminal just crops them sometimes.

github-actions[bot] commented 7 months ago

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual