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}"
#4
{counter:>02}
counter is the name that you want formated
> means it should be right-aligned
0 - fill-in symbol if len is less than the required length
2 - the required length

in the link I shared, in the first green box, the first row format_spec explains it
Quote:format_spec ::= [[fill]align][sign][#][0][width][grouping_option][.precision][type]
fill ::= <any character>
align ::= "<" | ">" | "=" | "^"
sign ::= "+" | "-" | " "
width ::= digit+
grouping_option ::= "_" | ","
precision ::= digit+
type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


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

Forum Jump:

User Panel Messages

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