[Tutor] importing strings

Jeff Younker jeff at drinktomi.com
Thu Sep 11 23:26:13 CEST 2008


On Sep 11, 2008, at 2:15 PM, Patrick wrote:
>
> I have been able to import a string from another module threw a
> dictionary but I can't seem to figure out how to do it so that I can
> insert a value into the %s placeholder afterwards.

The % operator is probably what you are looking for.

format = "this is a %s"
subst = 'test'
print format % subst

FYI: You shouldn't reply to a message when you have a new
question.  That attaches it to the previous topic.

- Jeff Younker - jeff at drinktomi.com -


More information about the Tutor mailing list