Код: Выделить всё
>>> from string import Template
>>> s = Template('$who likes $what')
>>> s.substitute(who='tim', what='kung pao')
'tim likes kung pao'
Код: Выделить всё
"Hello $person"
Подробнее здесь: https://stackoverflow.com/questions/768 ... te-strings
Мобильная версия