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


Groups > comp.lang.python > #107766

Re: Python Madlibs.py code and error message

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Stephen Hansen <me@ixokai.io>
Newsgroups comp.lang.python
Subject Re: Python Madlibs.py code and error message
Date Thu, 28 Apr 2016 00:08:50 -0700
Lines 29
Message-ID <mailman.179.1461827333.32212.python-list@python.org> (permalink)
References <3cff626c-28a2-499c-9877-de2df4d459d0@googlegroups.com> <dodj48Fb8o8U1@mid.individual.net> <6c0d96c5-c7f5-4659-a2e9-20f8d202d701@googlegroups.com> <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>
Mime-Version 1.0
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de Lj9bTIPAjJpCneKppEu0sgY0NXduonFH8qGzJYgIlk1A==
Return-Path <me@ixokai.io>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'string.': 0.04; 'subject:Python': 0.05; 'subject:code': 0.07; 'confuse': 0.09; 'received:internal': 0.09; 'python': 0.10; 'subject:error': 0.11; 'wed,': 0.15; 'better:': 0.16; 'compatible.': 0.16; 'formatting.': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.44': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:compute4.internal': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; '(not': 0.20; '3.x': 0.22; 'skip:% 10': 0.22; 'stephen': 0.22; 'examples': 0.24; 'header:In-Reply-To:1': 0.24; 'parameters': 0.27; 'values': 0.28; 'fine': 0.28; 'helpful.': 0.29; 'code': 0.30; 'url:python': 0.33; 'except': 0.34; 'running': 0.34; "isn't": 0.35; 'url:org': 0.36; 'url:library': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'version': 0.38; 'format': 0.39; 'to:addr:python.org': 0.40; 'url:3': 0.60; 'header:Message-Id:1': 0.61; 'show': 0.62; 'skip:n 10': 0.62; 'to,': 0.63; 'series': 0.65; 'skip:\xe2 10': 0.70; '10:32': 0.84; 'confusion.': 0.84; 'url:string': 0.84; 'wishing': 0.93
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=ixokai.io; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=8KRQBRXmTP45/qIVG2umfP0r4xQ=; b=j4DRUo Ak0rtr1egVjDN4Mg90wm6VBtxQnGVEaApsM74ZezCaG4EfYOPUQYfEMz0GGjmyZa ZS4mWL0/UbYDiPN/nLAud4g5W42B6Z7p1+4sMYyXtF77THr9TEQZH62qgHYCwdR2 u0xHFWMVBHbFE/KHXRdhmcMmRebDQ9Zh/dVJk=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=8KRQBRXmTP45/qI VG2umfP0r4xQ=; b=XHGHw+PBKTTYCawpNy2AhD1XH4OSaLRW4i5bidadWd1IVbB awlO0JsbnQrUdHXvnXvHrdC9/tbyTFJb5yZnQJMDZjAHv0YK2X5Q1/4e7XqvLs5Y f78RPcOJlmdgGTKgJgfN1UDJPzP4LoZkOpuHM9UPsMQ4KHWgGs1EgkIlOTZE=
X-Sasl-Enc XZQomO9Mg0ZdSZYKwVO+Bwxlp1yOWGKlFaCBLxhtl6bP 1461827330
X-Mailer MessagingEngine.com Webmail Interface - ajax-f1265324
In-Reply-To <85bn4ujk7p.fsf@benfinney.id.au>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <1461827330.3261212.591998673.4D215991@webmail.messagingengine.com>
X-Mailman-Original-References <3cff626c-28a2-499c-9877-de2df4d459d0@googlegroups.com> <dodj48Fb8o8U1@mid.individual.net> <6c0d96c5-c7f5-4659-a2e9-20f8d202d701@googlegroups.com> <1461820617.3238425.591942249.1484DAC3@webmail.messagingengine.com> <85fuu6jo1o.fsf@benfinney.id.au> <1461826246.3257796.591992793.54C5CC58@webmail.messagingengine.com> <85bn4ujk7p.fsf@benfinney.id.au>
Xref csiph.com comp.lang.python:107766

Show key headers only | View raw


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