Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #107766
| From | Stephen Hansen <me@ixokai.io> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Python Madlibs.py code and error message |
| Date | 2016-04-28 00:08 -0700 |
| Message-ID | <mailman.179.1461827333.32212.python-list@python.org> (permalink) |
| References | (3 earlier) <1461820617.3238425.591942249.1484DAC3@webmail.messagingengine.com> <85fuu6jo1o.fsf@benfinney.id.au> <1461826246.3257796.591992793.54C5CC58@webmail.messagingengine.com> <85bn4ujk7p.fsf@benfinney.id.au> <1461827330.3261212.591998673.4D215991@webmail.messagingengine.com> |
On Wed, Apr 27, 2016, at 11:55 PM, Ben Finney wrote: > Stephen Hansen <me@ixokai.io> writes: > > > On Wed, Apr 27, 2016, at 10:32 PM, Ben Finney wrote: > > > Better: when you have many semantically-different values, use named > > > (not positional) parameters in the format string. […] > > > > > > <URL:https://docs.python.org/3/library/string.html#formatstrings> > > > > Except the poster is not using Python 3, so all of this is for naught. > > Everything I described above works fine in Python 2. Any still-supported > version has ‘str.format’. This response is completely unhelpful. The OP is using Python 2, and using %-formatting, and so you give a series of examples of using str.format, to, what? Confuse matters? You can show using non-positional values using the format the user is using -- "%(name)s" formatting. You even reference a link to the Python 3 docs, even though the OP is running code which isn't 3.x compatible. Confusion. Wishing Python2 away isn't helpful. -- Stephen Hansen m e @ i x o k a i . i o
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python Madlibs.py code and error message Cai Gengyang <gengyangcai@gmail.com> - 2016-04-27 21:37 -0700
Re: Python Madlibs.py code and error message Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-04-28 16:50 +1200
Re: Python Madlibs.py code and error message Cai Gengyang <gengyangcai@gmail.com> - 2016-04-27 22:01 -0700
Re: Python Madlibs.py code and error message Stephen Hansen <me+python@ixokai.io> - 2016-04-27 22:16 -0700
Re: Python Madlibs.py code and error message Ben Finney <ben+python@benfinney.id.au> - 2016-04-28 15:32 +1000
Re: Python Madlibs.py code and error message Stephen Hansen <me@ixokai.io> - 2016-04-27 23:50 -0700
Re: Python Madlibs.py code and error message Ben Finney <ben+python@benfinney.id.au> - 2016-04-28 16:55 +1000
Re: Python Madlibs.py code and error message Stephen Hansen <me@ixokai.io> - 2016-04-28 00:08 -0700
Re: Python Madlibs.py code and error message Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-04-28 17:25 +1000
Re: Python Madlibs.py code and error message Cai Gengyang <gengyangcai@gmail.com> - 2016-05-03 04:12 -0700
Re: Python Madlibs.py code and error message Ben Finney <ben+python@benfinney.id.au> - 2016-04-28 17:17 +1000
Re: Python Madlibs.py code and error message Stephen Hansen <me+python@ixokai.io> - 2016-04-27 21:55 -0700
csiph-web