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


Groups > comp.lang.python > #102040

Re: import locale and print range on same line

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: import locale and print range on same line
Date Sun, 24 Jan 2016 00:58:06 +1100
Lines 34
Message-ID <mailman.177.1453557489.15297.python-list@python.org> (permalink)
References <2bda88dd-82e3-4e43-b49c-3945a0befdc2@googlegroups.com> <56a37b1e$0$1612$c3e8da3$5496439d@news.astraweb.com> <mailman.176.1453555148.15297.python-list@python.org> <56a383fa$0$1593$c3e8da3$5496439d@news.astraweb.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de Gwyerxs8zDYhm4QuDMUtYQ6A7Fr9qHhpJaHpdf7e1g/w==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'context': 0.05; 'cc:addr:python-list': 0.09; 'subject:same': 0.09; 'though...': 0.09; 'python': 0.10; 'jan': 0.11; 'question.': 0.13; "'hello": 0.16; '2016': 0.16; '24,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'shells': 0.16; 'subject:import': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'fixing': 0.22; 'keyboard': 0.22; 'trying': 0.22; 'am,': 0.23; 'sat,': 0.23; 'slightly': 0.23; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'error': 0.27; 'message-id:@mail.gmail.com': 0.27; 'said,': 0.27; 'print': 0.30; 'that.': 0.30; 'code': 0.30; 'everyone': 0.31; 'knows': 0.32; 'maybe': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'received:google.com': 0.35; 'but': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'things': 0.38; 'received:209': 0.38; 'your': 0.60; 'email addr:gmail.com': 0.62; 'different': 0.63; 'world': 0.64; 'wanting': 0.66; 'chrisa': 0.84; 'to:none': 0.91; 'why?': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=aLOlL89JCiYkIkIdReqrMOk+7AVTEETbtOuGd+7yKtQ=; b=u9pjA1cIUF4NfUnUhaGT9k0GT/FQvt7ZqBkscumXA9YNzMJgdqKDcf9bD/dKOSc56Q F71VqnWY8/+Sx3Pq7Z+0i5PYW8Bm3UB8tdEdmY4SUS3esXjyz9h+igWGGlOcDKgg/SoF X7hYAiNpbWAlJ3ktfFooRcXOklQnKP3H1EJliyXBhjblCr2JEti50asKhaGKGM/kqhA3 Wab2aR43bZxGfL9rMd1iVkSfCyUkrNKfftBHqDnXfdTyzRRygTr4H55OZRs20c58ql4D etWA0P9KXle/VXiEjDUxEJWzLFMDLIoCiBU5gEEQYcfUKsNMgrSDhJFIcB4FHZaYgFDW ijEA==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=aLOlL89JCiYkIkIdReqrMOk+7AVTEETbtOuGd+7yKtQ=; b=ko4VqbIcqKHLq0Cq2L0tZb5Eaw/qrximOEk9xEFElN+mQo1hoSgbAgtCXJnu157yQK J7L+rB5XkPHVYrWNHFMeiOM7Q5yV/HPyzh9fyap18pPKzORudTugv5vDhXW7W0Pme81o KPXCKJMQrPiB7FaKocTmA30qfIYQotNc6HPOa96wnm7YNAmhrpGZB3l2eOusNUqDC33b EYsPjkcgHavX6LB2kF2vW9XYOtAsxkgZe9dF5VE1FLHl6ggUlpicI7Z3VxNmb7w7/cuK FgwQ2jzNOgCNKEc+Hd2tLO+jjaJCCBN/rMGlkeV2e9yc6PSHoG9CzHe9JdI07aPu+0Rj RSxQ==
X-Gm-Message-State AG10YOSOsZxBCrvL/n8hlSOGEufWRmuE4Ovw9+fqV10DY9gw6gwqml7j0TuuDOgIZia2IIYGvHhSJ5u5TMMFFg==
X-Received by 10.107.40.76 with SMTP id o73mr7924105ioo.157.1453557486706; Sat, 23 Jan 2016 05:58:06 -0800 (PST)
In-Reply-To <56a383fa$0$1593$c3e8da3$5496439d@news.astraweb.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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>
Xref csiph.com comp.lang.python:102040

Show key headers only | View raw


On Sun, Jan 24, 2016 at 12:45 AM, Steven D'Aprano <steve@pearwood.info> wrote:
> On Sun, 24 Jan 2016 12:19 am, Chris Angelico wrote:
>
>> On Sun, Jan 24, 2016 at 12:07 AM, Steven D'Aprano <steve@pearwood.info>
>> wrote:
>>> On Sat, 23 Jan 2016 09:02 pm, raiwil@gmail.com wrote:
>>>
>>>> However I need to put the code on one single line.
>>>
>>> Why? Is the Enter key on your keyboard broken?
>>
>> Maybe it's for a python -c invocation.
>
>
> [steve@ando ~]$ python -c "for i in range(5):
>>     print 'hello world'
>> "
> hello world
> hello world
> hello world
> hello world
> hello world
> [steve@ando ~]$

Well, not everyone's shells are as awesome as bash... and not everyone
knows you can do that. That said, though... this is a good reason for
giving full context for the question. "I'm trying to X, but I get this
error because of Y. How would I go about fixing Y?" - response:
"Actually, you can do X in a slightly different way.".

Just sayin', there might be other reasons for wanting to put things
onto one line.

ChrisA

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


Thread

import locale and print range on same line raiwil@gmail.com - 2016-01-23 02:02 -0800
  Re: import locale and print range on same line Marko Rauhamaa <marko@pacujo.net> - 2016-01-23 12:36 +0200
    Re: import locale and print range on same line Vlastimil Brom <vlastimil.brom@gmail.com> - 2016-01-23 12:12 +0100
      Re: import locale and print range on same line Ramo <raiwil@gmail.com> - 2016-01-23 03:57 -0800
  Re: import locale and print range on same line Steven D'Aprano <steve@pearwood.info> - 2016-01-24 00:07 +1100
    Re: import locale and print range on same line Chris Angelico <rosuav@gmail.com> - 2016-01-24 00:19 +1100
      Re: import locale and print range on same line Steven D'Aprano <steve@pearwood.info> - 2016-01-24 00:45 +1100
        Re: import locale and print range on same line Chris Angelico <rosuav@gmail.com> - 2016-01-24 00:58 +1100
          Re: import locale and print range on same line Ramo <raiwil@gmail.com> - 2016-01-23 06:03 -0800
            Re: import locale and print range on same line Chris Angelico <rosuav@gmail.com> - 2016-01-24 01:53 +1100
        Re: import locale and print range on same line Terry Reedy <tjreedy@udel.edu> - 2016-01-23 21:45 -0500
        Re: import locale and print range on same line Chris Angelico <rosuav@gmail.com> - 2016-01-24 13:51 +1100
        Re: import locale and print range on same line eryk sun <eryksun@gmail.com> - 2016-01-24 02:00 -0600

csiph-web