python
from spiff import Spiff
name = "Alice"
age = 25
spiffed_text = Spiff("My name is {{name:<10}} and I am {{age}} years old.")
formatted_text = spiffed_text.format(name=name, age=age)
print(formatted_text)
My name is Alice and I am 25 years old.
python
from spiff import Spiff
spiffed_text = Spiff("This is {{text.bold.green}} and this is {{text.italic.red}}.")
formatted_text = spiffed_text.format()
print(formatted_text)
This is \u001b[1;32mand this is \u001b[0;31m.
python
from spiff import Spiff
age = 18
spiffed_text = Spiff("I am {{age}} years old. {{'You are an adult.' if age >= 18 else 'You are not an adult.'}}")
formatted_text = spiffed_text.format(age=age)
print(formatted_text)
I am 18 years old. You are an adult.