Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #98293
| From | input/ldompeling@casema.nl |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: raw_input and break |
| References | <4270fade-5f09-4935-a99a-f2be344202b2@googlegroups.com> |
| Message-ID | <adF_x.29624$Xj7.21693@fe35.am1> (permalink) |
| Organization | Pure Usenet - Usenet for everyone |
| Date | 2015-11-05 09:22 +0000 |
In reply to "tian.su.yale@gmail.com" who wrote the following:
> =E5=9C=A8 2015=E5=B9=B411=E6=9C=884=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89 UTC=
> -6=E4=B8=8B=E5=8D=883:45:09=EF=BC=8Cinput/ld...@casema.nl=E5=86=99=E9=81=93=
> =EF=BC=9A
> > 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=20
> > "break" the continues loop.
In this script it always break even when I not press 's'
I want that this script go's to if mindist > us_dist(15):
And when I press 's' its stop.
Any ideas ?
--------------------------------------------------------
while True:
enable_servo()
servo(90)
mindist = 80
choices = input("letter s to stop:")
if choices == 's':
print ("stop")
break
if mindist > us_dist(15):
bwd()
print ("backward 1x")
> > =20
> > I tried:
> > choices =3D raw_input
> > if choises =3D=3D s:
> > break
> > =20
> > But even when I not press "s" it "break"
> > I want that I not press "s" the script continues.
> > =20
> > Any ideas ?
> > =20
> > Thanks
> > =20
> > =20
> > =20
> > --=20
> > --------------------------------- --- -- -
> > Posted with NewsLeecher v7.0 Beta 2
> > Web @ http://www.newsleecher.com/?usenet
> > ------------------- ----- ---- -- -
>
> while True:
> inp =3D input("Enter whatever you want, letter 's' to stop: ")
> if inp =3D=3D 's':
> print("Program stopped.")
> break
> print("You just entered:", inp)
>
> Is this along the line that you are thinking? As pointed out earlier, it wi=
> ll be much easier for people to help if you can share the exact code you pu=
> t into and the error messages as well. Thanks and good luck!
> All the best,
> Tian
--
--------------------------------- --- -- -
Posted with NewsLeecher v7.0 Beta 2
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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