[Tutor] Re: logic testing

Derrick 'dman' Hudson dman@dman.ddts.net
Sat, 13 Jul 2002 00:24:10 -0500


--LwW0XdcUbUexiWVK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 11, 2002 at 03:36:06PM -0400, Andrei Kulakov wrote:
| On Thu, Jul 11, 2002 at 10:55:18AM -0700, Baker.Michael wrote:
| > i'm working with a game engine and would like a way to test "game logic"
| > with python.  the game engine runs as fast as it can - in the range of =
30 -
| > 100 frames per second. how can I make a python program that will run as=
 fast
| > as it can and still receive keyboard input?
| >=20
| > i cannot make loops work because attempts to capture raw_input() stall =
the
| > loop.
| >=20
| > i have not tried the cmd module - perhaps this will work????
|
| You can use threads - one thread captures user input, the other one
| shows stuff; you can also use select module but it's extremely
| confusing, to me at least.

If you want an example of select, let me know.  It is really quite
simple, once you know what it is trying to do.  (but don't look at the
manpage too closely, the C code is _much_ uglier than the Python code!)

-D

--=20
=20
Be sure of this:  The wicked will not go unpunished,
but those who are righteous will go free.
        Proverbs 11:21
=20
http://dman.ddts.net/~dman/


--LwW0XdcUbUexiWVK
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj0vuXoACgkQO8l8XBKTpRTmpgCfbwnGEcZqkDq33H6GBj9D2u/2
QqsAn0ev/n6DDlnmqGsdsCkref+uipYo
=Lkfn
-----END PGP SIGNATURE-----

--LwW0XdcUbUexiWVK--