raw_input and break

Joel Goldstick joel.goldstick at gmail.com
Wed Nov 4 16:56:40 EST 2015


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



More information about the Python-list mailing list