Am 29.10.2014 07:02 schrieb satishmlm...@gmail.com:

What does %%(%s)s mean in Python?

Weird question, as this has nothing to do with the code you just posted.

In general, what comes up to my mind, is that it is a format string to build another format string.

Example:

metafmt = '%%(%s)s'
fieldname = 'myfield'
fmt = metafmt % fieldname
# Now we have a fmt as if it was assigned with '%(myfield)s':
# %% -> %, %s -> myfield.

d = {fieldname: 'my content'}

print fmt % d
# this now prints the given field - which is noted in fieldname -
# from the given dict d.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to