所以我有以下内容:
myString = "This is %s string. It has %s replacements."
myParams = [ "some", "two" ]
# This is a function which works (and has to work) just like that
myFunction(myString, myParams)
现在,当我调试时,我执行以下操作:
print("Debug: myString = " + myString)
print("Debug: myParams = " + myParams)
但我想直接在一张印刷品中得到它,比如:
"Debug: This is some string. It has two replacements."
这有可能吗?就像是
print("Debug: myString = " + (myString % myParams))
?