Python threading tutorial?

Gerrit Holl gerrit at nl.linux.org
Thu Jan 9 16:12:36 EST 2003


Dennis Lee Bieber schreef op dinsdag  7 januari om 23:31:11 +0000:
> > with plotting such a World in a graphical environment where each
> > Creature, Wall, Air and Human instance have images walking around, as
> > in a game.
> >
>         "Air"? That's a difficult game if one has to worry about the air 
> moving away from them <G>

Well, the wind is blowing ;)
Those classes have attributes like 'moving' and 'penetrable', so the air
probably won't move while Creature()'s do.

>         If you really plan to develop it much, you might want to split it into 
> modules rather than one file. I can easily see a module for the World, 
> and another for "critter/human" (I see those as subclasses of, call it, 
> Organism).

Well, I already had differen modules, because the Air, Wall, Creature and
Human instances were in a different module, with a class hierarchy.

>         For just movement, having World "do the move" is a rough spot, but not 
> too blatant. For something with more envolvement, a collision should 
> probably send the information of the other party to the affected 
> threads so that the threads themselves can interact -- something you'd 
> need to do if you get into a situation where, for example, combat is 
> permitted and you have to track damage to both sides.

Yes, that's true. I have not reached that point yet in my road
to learn programming with threads, but I now know it is possible.
I am planning do develop it much but not in the next couple of
months; I'd prefer to do my high school exams this summer ;)

yours,
Gerrit.

-- 
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/





More information about the Python-list mailing list