Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7109

Re: new string formatting with local variables

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ethan@stoneleaf.us>
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; '2.7': 0.04; 'specifying': 0.07; 'python': 0.08; '>>>>': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'received:gator410.hostgator.com': 0.09; 'subject:string': 0.09; 'valueerror:': 0.09; '~ethan~': 0.09; 'wrote:': 0.14; 'captured': 0.16; 'received:72.11': 0.16; 'received:72.11.125': 0.16; 'received:72.11.125.166': 0.16; 'subject:formatting': 0.16; 'cc:addr:python-list': 0.17; 'to:2**1': 0.20; 'header:In-Reply- To:1': 0.21; 'cc:2**0': 0.22; 'cc:addr:python.org': 0.30; 'print': 0.31; 'header:User-Agent:1': 0.35; 'skip:{ 10': 0.35; 'subject:new': 0.37; 'subject:: ': 0.38; 'subject:with': 0.39; 'format': 0.40; 'received:websitewelcome.com': 0.67; 'python2.7': 0.84; 'subject:local': 0.84
Date Mon, 06 Jun 2011 14:07:46 -0700
From Ethan Furman <ethan@stoneleaf.us>
User-Agent Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version 1.0
To "Prasad, Ramit" <ramit.prasad@jpmchase.com>
Subject Re: new string formatting with local variables
References <mailman.2490.1307376958.9059.python-list@python.org> <slrniuq75p.47d.steve@news.mixmin.net> <4DED2320.7050708@stoneleaf.us> <0604E20B5F6F2F4784C9C8C71C5DD4DD2E349F5BD7@EMARC112VS01.exchad.jpmchase.net>
In-Reply-To <0604E20B5F6F2F4784C9C8C71C5DD4DD2E349F5BD7@EMARC112VS01.exchad.jpmchase.net>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - gator410.hostgator.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - stoneleaf.us
X-BWhitelist no
X-Source
X-Source-Args
X-Source-Dir
X-Source-Sender mail.admailinc.com ([192.168.10.136]) [72.11.125.166]:1249
X-Source-Auth ethan+stoneleaf.us
X-Email-Count 1
X-Source-Cap dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ==
Cc "'python-list@python.org'" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2506.1307393682.9059.python-list@python.org> (permalink)
Lines 11
NNTP-Posting-Host 82.94.164.166
X-Trace 1307393682 news.xs4all.nl 49042 [::ffff:82.94.164.166]:36593
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7109

Show key headers only | View raw


Prasad, Ramit wrote:
>> print "{} was captured by {}".format(solo, jabba)
> Is this Python2.7 specific?
> 
> Python 2.6.x : 
>>>> print "{} was captured by {}".format('t1', 't2')
> ValueError: zero length field name in format

Apparently it is 2.7 and greater -- my apologies for not specifying that.

~Ethan~

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

new string formatting with local variables Jabba Laci <jabba.laci@gmail.com> - 2011-06-06 12:15 -0400
  Re: new string formatting with local variables Steve Crook <steve@mixmin.net> - 2011-06-06 18:30 +0000
    Re: new string formatting with local variables Ethan Furman <ethan@stoneleaf.us> - 2011-06-06 11:57 -0700
    RE: new string formatting with local variables "Prasad, Ramit" <ramit.prasad@jpmchase.com> - 2011-06-06 16:21 -0400
    Re: new string formatting with local variables Ethan Furman <ethan@stoneleaf.us> - 2011-06-06 14:07 -0700

csiph-web