Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Joel Goldstick Newsgroups: comp.lang.python Subject: Re: raw_input and break Date: Wed, 4 Nov 2015 16:56:40 -0500 Lines: 45 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 98X1SB6jnDeHiUnteeJh3gKITyr7NFeBLR1ywiQlL6pQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:209.85.223': 0.03; 'cc:addr:python-list': 0.09; 'loop.': 0.09; 'spelling': 0.09; 'wed,': 0.15; '"break"': 0.16; '"s"': 0.16; '"while': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:break': 0.16; 'tried:': 0.16; 'wrote:': 0.16; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'posted': 0.21; 'header:In- Reply-To:1': 0.24; 'script': 0.25; '----': 0.27; 'message- id:@mail.gmail.com': 0.27; '---': 0.28; 'spaces': 0.29; '-----': 0.29; 'url:mailman': 0.30; 'skip:- 30': 0.32; 'url:python': 0.33; 'choices': 0.33; 'skip:- 10': 0.34; 'url:listinfo': 0.34; 'skip:& 20': 0.35; 'received:google.com': 0.35; 'nov': 0.35; 'but': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'skip:& 10': 0.37; 'thanks': 0.37; 'received:209': 0.38; 'url:mail': 0.40; 'your': 0.60; 'press': 0.61; 'to:none': 0.91; '4:44': 0.91; 'joel': 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=6P4Hp7udmU6lT8Igz5PWUgjbPih04o5m3NdyJrdWEa8=; b=ABw8hIZ1jbYtey4cqMo5Rhepf/AXTa7EBR4Z1Hdx48auHr7RTfgWFZyx82WZSYJxuo yHRakJaYyf+NYHhmdiGTAlW8qj1m5vMi18aY1gO+eEVfsdsQbjRoGzfiLccsPKNS/SGO mK47KMZBeeCJrkeH3BmRC/eBgihEAljhTfBSlbXMrCHaPKRwzbf6h1OPyWM01ii6onQ6 FdrVZr4yOWu45m2eXh7nY2vz+E1AUXBnJ0NgJ71YNu3go2c1c4L4ngqtgcf01PDcvGOn W6yVm40sGIB/DQMQf67Mgn7dEgn30OvHwMb8VH5mKrjpbcOSXHEq2z9IhLY+5rjIH+Jd Tqlg== X-Received: by 10.107.130.209 with SMTP id m78mr6031992ioi.18.1446674200396; Wed, 04 Nov 2015 13:56:40 -0800 (PST) In-Reply-To: X-Content-Filtered-By: Mailman/MimeDel 2.1.20+ X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:98246 On Wed, Nov 4, 2015 at 4:44 PM, wrote: > I have an continues loop with "while True:" > Now I want to use "raw_input" and when I press "s" on the keybord that it > will > "break" the continues loop. > > I tried: > choices = raw_input > if choises == s: > break > > But even when I not press "s" it "break" > I want that I not press "s" the script continues. > > Any ideas ? > You need to quote the s: if choices == 's' you need to check your spelling -- you have choices and choises You need to indent break 4 spaces > > Thanks > > > > -- > --------------------------------- --- -- - > Posted with NewsLeecher v7.0 Beta 2 > Web @ http://www.newsleecher.com/?usenet > ------------------- ----- ---- -- - > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays