Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.05; 'ignored': 0.05; 'formatting': 0.07; 'brackets': 0.09; 'forcing': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:string': 0.09; 'python': 0.11; 'braces,': 0.16; 'dots': 0.16; 'fancy': 0.16; 'formatting.': 0.16; 'knight': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.16; 'string': 0.17; 'skip': 0.18; 'examples': 0.18; 'language': 0.19; 'thanks,': 0.19; 'lawrence': 0.22; '2015': 0.23; '(you': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'figure': 0.27; 'perl': 0.29; 'maybe': 0.31; 'code': 0.31; 'language.': 0.32; 'ordered': 0.33; 'steven': 0.33; 'subject:?': 0.34; 'google': 0.34; 'to:addr :python-list': 0.35; 'but': 0.36; 'there': 0.36; 'thanks': 0.36; 'hi,': 0.37; 'should': 0.37; "didn't": 0.37; 'subject:: ': 0.37; 'received:org': 0.38; 'stuff': 0.38; 'pm,': 0.39; 'to:addr:python.org': 0.39; 'mark': 0.40; 'subject:the': 0.40; 'some': 0.40; 'our': 0.64; 'url:info': 0.71; 'pythonistas,': 0.84; 'doctor': 0.91; 'sheet': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Cheat sheet for the new string formatting? Date: Mon, 08 Jun 2015 23:20:07 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: host-92-24-221-219.ppp.as43234.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433802033 news.xs4all.nl 2874 [2001:888:2000:d::a6]:35445 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92351 On 08/06/2015 21:05, Steven K Knight wrote: > > > June 8 2015 3:11 PM, "Skip Montanaro" >> wrote: > > I have so far ignored the new string formatting (you know, the stuff > with all the braces, dots and brackets that make Python strings look > like Perl code ). I am still only using Python 2.7, but have > recently started forcing myself to use the print() function. I > figure maybe I should also start to come to grips with the fancy new > string formatting. > > Is there a cheat sheet around which shows some side-by-side examples > of the {}-style and printf-style? I didn't see anything with a few > Google searches. > Thx, > Skip > > > Hi, > > I think http://pyformat.info/ is what you're looking for. > > Thanks, > ​ > -- > Steven Knight > > Many thanks for the link, just what the doctor ordered :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence