X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63 Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!news.muarf.org!news.roellig-ltd.de!news.babsi.de!open-news-network.org!news2.open-news-network.org!.POSTED!not-for-mail From: Thomas Rachel Newsgroups: comp.lang.python Subject: Re: %%(%s)s mean in python Date: Wed, 29 Oct 2014 16:12:44 +0100 Organization: A not so newly installed InterNetNews server Lines: 22 Message-ID: References: <76c6409c-5289-4cf2-b80a-6349325356c6@googlegroups.com> NNTP-Posting-Host: 2001:41d0:8:4cbf:25:5e92:1e80:90b Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news2.open-news-network.org 1414596002 18961 2001:41d0:8:4cbf:25:5e92:1e80:90b (29 Oct 2014 15:20:02 GMT) X-Complaints-To: abuse@open-news-network.org NNTP-Posting-Date: Wed, 29 Oct 2014 15:20:02 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 Hamster/2.1.0.11 In-Reply-To: <76c6409c-5289-4cf2-b80a-6349325356c6@googlegroups.com> Xref: csiph.com comp.lang.python:79916 Am 29.10.2014 07:02 schrieb satishmlmlml@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.