From: Bruce S. <Bru...@nc...> - 2007-01-23 22:00:53
|
If you're not writing a graphics program I think you just want to write=20 a pure Python program. I think you can find on the web tutorials on=20 simple Python programs that response to input. Bruce Sherwood Poul Riis wrote: > Is there a smarter way to do the keyboard interrupt in the following > example? > I don't really need the window but if I make it invisible by uncommenti= ng > the 5th line the program doesn't work as before.=20 >=20 > Yours, > Poul Riis >=20 >=20 >=20 > from visual import * > from time import * > scene.width=3D25 > scene.height=3D25 > #scene.visible=3D0 > oldreadkey=3D0 >=20 > for i in range(1,10): > readkey=3Dscene.kb.keys > print i,readkey > if readkey!=3D0: > break > sleep(0.25) > print "Once again..." >=20 > oldreadkey=3Dreadkey > for i in range(1,10): > readkey=3Dscene.kb.keys > print i,readkey > if readkey>oldreadkey: > break > sleep(0.25) > print "Yet another time..." >=20 > oldreadkey=3Dreadkey > for i in range(1,10): > readkey=3Dscene.kb.keys > print i,readkey > if readkey>oldreadkey: > break > sleep(0.25) > print "The end" >=20 >=20 >=20 > -----------------------------------------------------------------------= - >=20 >=20 >=20 > ########################################### > Denne meddelelse med evt. vedl=E6g er scannet af SkoleKom ved hj=E6lp = af F-Secure virusscanner. >=20 > For yderligere information, > http://forside.skolekom.dk/indhold/punkt1/viruspolitik >=20 >=20 > -----------------------------------------------------------------------= - >=20 > -----------------------------------------------------------------------= -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share= your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV >=20 >=20 > -----------------------------------------------------------------------= - >=20 > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |