Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.060 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'string': 0.09; 'input,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'evaluates': 0.16; 'expression.': 0.16; 'renamed': 0.16; 'unsafe': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'input': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '>': 0.26; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'returned': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'file': 0.32; 'raw': 0.33; 'trouble': 0.34; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'thanks': 0.36; 'hi,': 0.36; 'example,': 0.37; 'received:209': 0.37; 'conditions.': 0.38; 'skip:& 20': 0.39; 'does': 0.39; 'how': 0.40; 'most': 0.60; 'name': 0.63; 'such': 0.63; '30,': 0.65; 'to:addr:gmail.com': 0.65; 'prompt': 0.68; 'default': 0.69; 'user,': 0.69; 'reply!': 0.84; '2013': 0.98 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:to :cc:content-type; bh=6Nc7OkH96mt2fvDrhjlZ/5yNDQLQpNMyCxz/5tjcH+k=; b=UOG3bThMty8UOMPxofngPeGq9VoX41xVcCaYSAIgiAyKP+9Bk4Fb0Q1ElokvpILlot Lhs353VzmRIsAStfMMM/JDWGHqK+TrRb4scsjj6fWExh9CCtS/iqwvwF7WwFhBzUhNJE +M70L2fljktOoQoeV8S9qT5a6kxdbljJ8jvm1zlYmNxqUx+nqf1jXuNc7uy4q7oP4f2I pAqYf93+gO9dELa/SZzZi1gYcrRXxOai8k+euwwvaljVcw7pG3XHX1woTZZyoEk/PYb5 fOLvLsHA7VKU0IvUDNjwbOXjhvUwVIU78bOillXDB+4zzNi0GgQMQPG+5Mc+ftwfWX69 z6wQ== MIME-Version: 1.0 X-Received: by 10.58.116.229 with SMTP id jz5mr5209363veb.14.1369915853598; Thu, 30 May 2013 05:10:53 -0700 (PDT) In-Reply-To: <7f9b7a2e-3142-468b-a2ce-9434c1ad7989@googlegroups.com> References: <7f9b7a2e-3142-468b-a2ce-9434c1ad7989@googlegroups.com> Date: Thu, 30 May 2013 13:10:53 +0100 Subject: Re: User Input From: =?ISO-8859-1?Q?F=E1bio_Santos?= To: Eternaltheft Content-Type: multipart/alternative; boundary=047d7b5d5f66d38aa904ddee633d Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369916173 news.xs4all.nl 15985 [2001:888:2000:d::a6]:39455 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46464 --047d7b5d5f66d38aa904ddee633d Content-Type: text/plain; charset=ISO-8859-1 On 30 May 2013 12:58, "Eternaltheft" wrote: > > On Thursday, May 30, 2013 7:33:41 PM UTC+8, Eternaltheft wrote: > > Hi, I'm having trouble oh how prompt the user to enter a file name and how to set up conditions. For example, if there's no file name input by the user, a default is returned > > Thanks for such a fast reply! and no im not using raw input, im just using input. does raw_input work on python 3? On python 2, the function to prompt the user for input and return a string is raw_input. On python 3 that function has been renamed to input. However on python 2 input is something else. It also evaluates the input as a python expression. That makes it unsafe to use in most circumstances. --047d7b5d5f66d38aa904ddee633d Content-Type: text/html; charset=ISO-8859-1


On 30 May 2013 12:58, "Eternaltheft" <eternaltheft@gmail.com> wrote:
>
> On Thursday, May 30, 2013 7:33:41 PM UTC+8, Eternaltheft wrote:
> > Hi, I'm having trouble oh how prompt the user to enter a file name and how to set up conditions. For example, if there's no file name input by the user, a default is returned
>
> Thanks for such a fast reply! and no im not using raw input, im just using input. does raw_input work on python 3?

On python 2, the function to prompt the user for input and return a string is raw_input.

On python 3 that function has been renamed to input.

However on python 2 input is something else. It also evaluates the input as a python expression. That makes it unsafe to use in most circumstances.

--047d7b5d5f66d38aa904ddee633d--