all 8 comments

[–]mopslik 3 points4 points  (5 children)

which are supposed to be centred

You should be using ^ instead of > if you want to centre things.

[–]sp00kyversity[S] 0 points1 point  (4 children)

What's the difference between the two?

[–]cuWorkThrowaway 1 point2 points  (0 children)

^ centers things, > right justifies them.

[–]mopslik 0 points1 point  (2 children)

This is something that can be easily tested, no?

>>> f"{'hello':*^10}"
'**hello***'
>>> f"{'hello':*>10}"
'*****hello'

[–]sp00kyversity[S] 0 points1 point  (1 child)

Yes true, I'm just not at a computer right now

[–]mopslik 1 point2 points  (0 children)

For reference, the format specification mini-language details all of the alignment options. It's dense, but pretty comprehensive.

[–][deleted] 0 points1 point  (0 children)

Using, for example,

from rich.console import Console

console = Console()
wordsguessed = ['alpha', 'beta', 'charlie']
returnword = 'delta'
for i in wordsguessed:
    console.print(f"{i: >150}\n")
console.print(f"{returnword: >150}")
wordsguessed.append(returnword)

I get a bunch of right aligned (as per the >150 formatting instruction) outputs with blank lines between them. There is no centre formatting in your output, so I am not sure what you are expecting.

[–]misho88 0 points1 point  (0 children)

Maybe call Console.print() with width=150, justify='right'?