right adjusted strings containing umlauts

jfharden at gmail.com jfharden at gmail.com
Thu Aug 8 10:43:11 EDT 2013


On Thursday, 8 August 2013 15:23:46 UTC+1, Kurt Mueller  wrote:
> I'd like to print strings right adjusted.
> 
> print( '>{0:>3}<'.format( 'ä' ) )
> 

Make both strings unicode

print( u'>{0:>3}<'.format( u'ä' ) )

Why not use rjust for it though?

u'ä'.rjust(3)

-- 
Jonathan



More information about the Python-list mailing list