Example:
from blessed import Terminal
term = Terminal()
strings = ["123", "456", "🗣️ "]
print("with term.ljust:")
for string in strings:
print(f"{term.ljust(string, 5)} 1")
print("without term.ljust:")
for string in strings:
print(f"{string:<5} 1")
Output (term.ljust adds one additional cell):
with term.ljust:
123 1
456 1
🗣️ 1
without term.ljust:
123 1
456 1
🗣️ 1
However this is not consistent with all unicode sequences. For example, changing strings to ["123", "456", "🤔 "] gives:
Output (term.ljust padding is correct):
with term.ljust:
123 1
456 1
🤔 1
without term.ljust:
123 1
456 1
🤔 1