[Tutor] Re: How to leave literal %s in output of formatted string
Jeff Kowalczyk
jtk@yahoo.com
Thu May 15 11:25:01 2003
Good point, the direct subsitution will do the trick
>>> s = '%s download %s' % (VendorID, '%s')
If anyone knows, I'm still curious to know if there is an
escape character for %, for more complex cases that
may come up in the future.
Adam wrote: -------------------
This is a suggestion from one newbie to another--I'm sure there's a
better way to do this, but this worked:
VendorID = 'ACME'
ReplacementString = '%s'
s = '%s Download %s' % (VendorID, ReplacementString)