interpolate¶
-
decida.
interpolate
(s, iframe=1)¶ synopsis:
Interpolate local and global variables into string.arguments:
s (str)
template string with $var or ${var} placeholdersiframe (int, default=1)
frame index (1=calling frame, 2=callers calling frame, etc.)example:
>>> import decida >>> x = 23 >>> a = "ten" >>> t = decida.interpolate(""" ... a : $a ... x : $x ... """) >>> print t a : ten x : 23