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


Groups > comp.lang.python > #64302

Re: question about input() and/or raw_input()

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'input,': 0.09; 'newline': 0.09; 'subject:()': 0.09; 'subtle': 0.09; 'subject:question': 0.10; 'cc:addr:python-list': 0.11; 'gui': 0.12; 'jan': 0.12; '(modulo': 0.16; 'file-like': 0.16; 'flush': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'merely': 0.16; 'wrote:': 0.18; 'not,': 0.20; 'input': 0.22; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'equivalent': 0.26; 'subject:/': 0.26; 'asking': 0.27; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'sense': 0.34; "i'd": 0.34; 'but': 0.35; 'received:google.com': 0.35; 'representing': 0.36; "didn't": 0.36; 'method': 0.36; 'too': 0.37; 'level': 0.37; 'that,': 0.38; 'read': 0.60; 'lower': 0.61; 'simple': 0.61; "you're": 0.61; 'more': 0.64; '20,': 0.68; 'presented': 0.69; 'edwards': 0.91; 'to:none': 0.92
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=QTB9xN6AU+EuBdkkSoIq8PyNMl03T6nha6WsJRXSefw=; b=Xa9Tkl+W+OwG5Eo23MKKaD1+McZTdF/SZzg0cHgibsKSxrWRnuNVuMX/qUB75MptE0 M9/+FTE+O4+LCQVgk4lFPASE7etVB1NsxYqfaIuOyJDh+fl38DdgA+WnB5jU5Yr0Zle2 YEwDkkYLDuzHq5CGAHp2CDLjTXtqUWrK+75HIuuAmKGnhOlG0fvyJxYwxqVNOnc1sP6q ewksudOu/ANNd1KZcITXI/T9UhwmJH6KmT2KAwwI2zPO1bfHBFTbFU8FhZHZqyy2sb4d WM86g9aF10geusZYIVZgEZQooHLe09bqV+EM3r0Z9YRhBG2tkVnM510V3k6oe7TorT/w noIw==
MIME-Version 1.0
X-Received by 10.66.43.135 with SMTP id w7mr13942210pal.97.1390154393497; Sun, 19 Jan 2014 09:59:53 -0800 (PST)
In-Reply-To <lbh2qv$ls5$1@reader1.panix.com>
References <roy-97803E.13302018012014@news.panix.com> <mailman.5690.1390080826.18130.python-list@python.org> <lbgtlo$87i$1@reader1.panix.com> <mailman.5710.1390151568.18130.python-list@python.org> <lbh2qv$ls5$1@reader1.panix.com>
Date Mon, 20 Jan 2014 04:59:53 +1100
Subject Re: question about input() and/or raw_input()
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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>
Newsgroups comp.lang.python
Message-ID <mailman.5711.1390154402.18130.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1390154402 news.xs4all.nl 2891 [2001:888:2000:d::a6]:46770
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:64302

Show key headers only | View raw


On Mon, Jan 20, 2014 at 4:42 AM, Grant Edwards <invalid@invalid.invalid> wrote:
> 2) I didn't claim that sys.stdin.readline() was as simple as using
>    input.  I didn't claim it was preferable.  I merely presented it as
>    a refutation to the argument that if you don't use input/raw_input
>    then you have to use a GUI toolkit.

I'd draw a subtle distinction here, btw. With sys.stdin.readline(),
you're asking to read a line from standard input, but with
(raw_)input(), you're asking to read one line from the console. If
it's been redirected, that's going to be equivalent (modulo newline
handling), but if not, it would make sense for (raw_)input() to call
on GNU Readline, where sys.stdin.readline() shouldn't. Calling a
method on a file-like object representing stdin feels lower level than
"ask the user for input with this prompt" (which might well do more
than that, too - eg it might flush sys.stdout).

ChrisA

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


Thread

question about input() and/or raw_input() Roy Smith <roy@panix.com> - 2014-01-18 13:30 -0500
  Re: question about input() and/or raw_input() Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-18 18:41 +0000
  Re: question about input() and/or raw_input() Emile van Sebille <emile@fenx.com> - 2014-01-18 10:49 -0800
  Re: question about input() and/or raw_input() Peter Otten <__peter__@web.de> - 2014-01-18 20:05 +0100
  Re: question about input() and/or raw_input() Terry Reedy <tjreedy@udel.edu> - 2014-01-18 16:33 -0500
    Re: question about input() and/or raw_input() Grant Edwards <invalid@invalid.invalid> - 2014-01-19 16:14 +0000
      Re: question about input() and/or raw_input() Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-01-19 12:12 -0500
        Re: question about input() and/or raw_input() Grant Edwards <invalid@invalid.invalid> - 2014-01-19 17:42 +0000
          Re: question about input() and/or raw_input() Chris Angelico <rosuav@gmail.com> - 2014-01-20 04:59 +1100
  Re: question about input() and/or raw_input() Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-01-18 21:17 -0500
  Re: question about input() and/or raw_input() Chris Angelico <rosuav@gmail.com> - 2014-01-19 13:46 +1100
  Re: question about input() and/or raw_input() Rustom Mody <rustompmody@gmail.com> - 2014-01-18 20:15 -0800
    Re: question about input() and/or raw_input() Chris Angelico <rosuav@gmail.com> - 2014-01-19 15:21 +1100
      Re: question about input() and/or raw_input() Rustom Mody <rustompmody@gmail.com> - 2014-01-18 20:43 -0800
        Re: question about input() and/or raw_input() Chris Angelico <rosuav@gmail.com> - 2014-01-19 15:59 +1100
          Re: question about input() and/or raw_input() Rustom Mody <rustompmody@gmail.com> - 2014-01-19 00:26 -0800
            Re: question about input() and/or raw_input() Chris Angelico <rosuav@gmail.com> - 2014-01-19 21:39 +1100
            Re: question about input() and/or raw_input() Ethan Furman <ethan@stoneleaf.us> - 2014-01-19 08:14 -0800
            Re: question about input() and/or raw_input() Chris Angelico <rosuav@gmail.com> - 2014-01-20 03:38 +1100
            Re: question about input() and/or raw_input() Ethan Furman <ethan@stoneleaf.us> - 2014-01-19 09:50 -0800
            Re: question about input() and/or raw_input() Chris Angelico <rosuav@gmail.com> - 2014-01-20 05:41 +1100
            Re: question about input() and/or raw_input() Ethan Furman <ethan@stoneleaf.us> - 2014-01-19 11:16 -0800
  Re: question about input() and/or raw_input() Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-01-19 06:24 +0000
  Re: question about input() and/or raw_input() Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-19 18:07 +0000
    Re: question about input() and/or raw_input() Grant Edwards <invalid@invalid.invalid> - 2014-01-19 18:15 +0000
      Re: question about input() and/or raw_input() Roy Smith <roy@panix.com> - 2014-01-19 13:37 -0500
        Re: question about input() and/or raw_input() Chris Angelico <rosuav@gmail.com> - 2014-01-20 05:43 +1100
        Re: question about input() and/or raw_input() Grant Edwards <invalid@invalid.invalid> - 2014-01-19 19:11 +0000
        Re: question about input() and/or raw_input() Gene Heskett <gheskett@wdtv.com> - 2014-01-19 15:09 -0500
      Re: question about input() and/or raw_input() Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-19 19:17 +0000
      Re: question about input() and/or raw_input() Larry Martell <larry.martell@gmail.com> - 2014-01-19 12:24 -0700
      Re: question about input() and/or raw_input() Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-19 19:29 +0000
  Re: question about input() and/or raw_input() Gene Heskett <gheskett@wdtv.com> - 2014-01-19 15:12 -0500
  Re: question about input() and/or raw_input() Larry Martell <larry.martell@gmail.com> - 2014-01-19 13:22 -0700

csiph-web