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


Groups > comp.lang.python > #98246

Re: raw_input and break

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Joel Goldstick <joel.goldstick@gmail.com>
Newsgroups comp.lang.python
Subject Re: raw_input and break
Date Wed, 4 Nov 2015 16:56:40 -0500
Lines 45
Message-ID <mailman.30.1446674207.16136.python-list@python.org> (permalink)
References <h%u_x.29450$bN3.2901@fx06.am1>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de 98X1SB6jnDeHiUnteeJh3gKITyr7NFeBLR1ywiQlL6pQ==
Return-Path <joel.goldstick@gmail.com>
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 <h%u_x.29450$bN3.2901@fx06.am1>
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 <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:98246

Show key headers only | View raw


On Wed, Nov 4, 2015 at 4:44 PM, <input/ldompeling@casema.nl> 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

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


Thread

raw_input and break input/ldompeling@casema.nl - 2015-11-04 21:44 +0000
  Re: raw_input and break Ian Kelly <ian.g.kelly@gmail.com> - 2015-11-04 14:54 -0700
  Re: raw_input and break Joel Goldstick <joel.goldstick@gmail.com> - 2015-11-04 16:56 -0500
    Re: raw_input and break input/ldompeling@casema.nl - 2015-11-04 22:37 +0000
      Re: raw_input and break Steven D'Aprano <steve@pearwood.info> - 2015-11-05 11:44 +1100
  Re: raw_input and break tian.su.yale@gmail.com - 2015-11-04 21:39 -0800
    Re: raw_input and break input/ldompeling@casema.nl - 2015-11-05 09:22 +0000
      Re: raw_input and break Peter Otten <__peter__@web.de> - 2015-11-05 11:01 +0100
        Re: raw_input and break input/ldompeling@casema.nl - 2015-11-05 10:40 +0000
          Re: raw_input and break Peter Otten <__peter__@web.de> - 2015-11-05 12:38 +0100
            Re: raw_input and break input/ldompeling@casema.nl - 2015-11-05 12:59 +0000
              Re: raw_input and break Peter Otten <__peter__@web.de> - 2015-11-05 15:16 +0100
                Re: raw_input and break input/ldompeling@casema.nl - 2015-11-05 14:34 +0000
                Re: raw_input and break Peter Otten <__peter__@web.de> - 2015-11-05 18:06 +0100
                Re: raw_input and break input/ldompeling@casema.nl - 2015-11-05 17:28 +0000
                Re: raw_input and break Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-11-05 20:09 -0500
                Re: raw_input and break input/ldompeling@casema.nl - 2015-11-06 05:08 +0000
                Re: raw_input and break input/ldompeling@casema.nl - 2015-11-06 11:50 +0000
                Re: raw_input and break Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-11-06 08:25 -0500

csiph-web