[Pythonmac-SIG] Replace placeholder in string with content of ONE variable???

Eric Wichterich eric.wichterich at gmx.de
Wed Aug 27 23:42:51 EDT 2003


Hello,

Can anyone help me out? I want to replace a string with several 
placeholders (%s) with the content of ONE variable.
Here is a small (silly) example:

action = "barking"
print "My %s dog keeps %s all the time." % action

The output I am looking for is "My barking dog keeps barking all the 
time."

Does anybody know how to proceed?

Thank you very much,
Eric




More information about the Pythonmac-SIG mailing list