[Python-ideas] Format character to center strings
Philipp A.
flying-sheep at web.de
Sat Mar 28 18:07:32 CET 2015
because you should use '{:^20}'.format(s) instead of the obsolete % stuff.
Rob Cliffe <rob.cliffe at btinternet.com> schrieb am Sa., 28. März 2015 um
16:01 Uhr:
> As a string can be left-justified (within a given width) using e.g.
> '%-20s' % s
> and right-justified using
> '%+20s' % s # or '%20s' % s
> why not allow a string to be centered using
> '%=20s' %s
>
> Rob Cliffe
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150328/ad0c3545/attachment.html>
More information about the Python-ideas
mailing list