[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame+threading+windows




On Aug 4, 2006, at 6:28 AM, Luke Paireepinart wrote:

Hi Lars.
Lars Friedrich wrote:
Hello,
[snip examples]
What would your solution be? Write a "real" program, with no possibility
to use python interactively? Doing something completely different?


You could make some kind of UDP listening module and whenever you receive a command
just execute it.
and then just write a separate script that sends commands to 127.0.0.1 on whichever port you decide to use.
I think you could do this without threads, if you put the code for the listening inside of your main game loop,
but I'm not sure.

You can write an interactive interpreter that doesn't block. You're not going to be using raw_input() from a GUI app anyway, so non- blocking is more or less how you *have* to write it. Still, I don't see any reason at all to even think about threads. Even multiple processes sounds unnecessary here.


-bob