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


Groups > comp.lang.python > #107767

Re: Python Madlibs.py code and error message

From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: Python Madlibs.py code and error message
Date 2016-04-28 17:17 +1000
Message-ID <mailman.180.1461827876.32212.python-list@python.org> (permalink)
References (4 earlier) <85fuu6jo1o.fsf@benfinney.id.au> <1461826246.3257796.591992793.54C5CC58@webmail.messagingengine.com> <85bn4ujk7p.fsf@benfinney.id.au> <1461827330.3261212.591998673.4D215991@webmail.messagingengine.com> <857ffijj6s.fsf@benfinney.id.au>

Show all headers | View raw


Stephen Hansen <me@ixokai.io> writes:

> On Wed, Apr 27, 2016, at 11:55 PM, Ben Finney wrote:
> > Everything I described above works fine in Python 2.
>
> This response is completely unhelpful.

I'll let the OP be the judge of that.

> 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?

I don't know why you keep raising Python 2 as though it matters. As I
pointed out, everything I discussed works fine on Python 2 without any
change.

More to the point, *even if* they continue using ‘%’ formatting, the
primary point was to use named parameters.

That is relevant to Python 3 and Python 2; it is relevant to ‘%’
formatting and ‘str.format’ formatting. None of those need to change.

So I encourage the OP to try using named format parameters in *any* of
those, and then judge whether it is helpful.

-- 
 \              “Begin with false premises and you risk reaching false |
  `\   conclusions. Begin with falsified premises and you forfeit your |
_o__)                          authority.” —Kathryn Schulz, 2015-10-19 |
Ben Finney

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


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