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


Groups > comp.lang.python > #7109

Re: new string formatting with local variables

Date 2011-06-06 14:07 -0700
From Ethan Furman <ethan@stoneleaf.us>
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>
Newsgroups comp.lang.python
Message-ID <mailman.2506.1307393682.9059.python-list@python.org> (permalink)

Show all headers | 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