Python Forum
fmt_directory_entry = "{counter:>02}. {director:<52} {avg}"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
fmt_directory_entry = "{counter:>02}. {director:<52} {avg}"
#6
from https://docs.python.org/2/library/string.html
Aligning the text and specifying a width:
>>> '{:<30}'.format('left aligned')
'left aligned                  '
>>> '{:>30}'.format('right aligned')
'                 right aligned'
>>> '{:^30}'.format('centered')
'           centered           '
>>> '{:*^30}'.format('centered')  # use '*' as a fill char
'***********centered***********'
Look at the last example and the useful use comment
Reply


Messages In This Thread
RE: fmt_directory_entry = "{counter:>02}. {director:<52} {avg}" - by deanhystad - Apr-09-2020, 02:18 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020