Basically I'm trying to take a Template String and store it in a variable for later use. I'm new with Python and programming languages in general so I'm finding difficulty in doing this. This is the code I'm using to generate the string:
from string import Template s = Template('$who has $amount dollars.') s.substitute(who='Merideth', amount='65')Fairly simple, but how do I take that all and store it in a variable? I'd like to store the string in a variable and print it later.
Thanks in advance. Hate to bother with a beginner question, but we all have to start somewhere...
's.template' contains the original string passed to Template().
s.substitute() returns a string object which can be assigned to a variable.
HTH