[Tutor] sorting variables

2007-10-31 Thread ted b
I am using pygame and i have three variables that i want to sort (var1, var2 and var3) and be able to refer to them later in a statement that will use them in sorted order: the statement i am using is: objSprites = pygame.sprite.OrderedUpdates(var1, var2, var3) and i want var1, var2 and var3 t

[Tutor] sorting / outputting varibales

2007-11-01 Thread ted b
If i input the following in python: var1 = 7 var2 = 9 var3 = 5 args = [var1, var2, var3] args.sort() then if if type: args the output is [5, 7, 9] but i want the output to be [var3, var1, var2] is there a function that will output the variable names in the order they

Re: [Tutor] sorting / outputting varibales

2007-11-01 Thread ted b
Thanks Kent, and Evert, and everyone, I really appreciate the advice on etiqutte and all your help. I will think through my questions much more thoroughly before any further inquiries and will 'reply to all' as advised. --- Kent Johnson <[EMAIL PROTECTED]> wrote: > ted b wrote

[Tutor] class accessing another's updated property

2007-11-14 Thread ted b
I want class One to be able to access access class Two's value property after its been updated. Everytime I try (by running, say testTwo().value) I get the __init__ value. The update method fro class Two is called elsewhere in the program, and I want class One's "getTwo" method to access class Two'

[Tutor] selecting elements from a list that do not meet selection criteria

2007-11-15 Thread ted b
Is there a way i can select all elements from a list that do not meet selection criteria. I want to be able to select elements that have values of, say, < 1 but only if at least one of the elements has a value of > 0. What i mean is, for example, in the code below, if one of the elements of "list

[Tutor] affecting all classes if one class is affected by an event - pygame

2007-11-16 Thread ted b
I am trying to figure out how to make a class instance respond the same way as another class instance if the other is affected by some event. I have been playing around with inheritance, and have tried other stuff, but i am somewhat of a newbie and I have been having difficulty (but you guys, parti

[Tutor] How to iterate and update subseqent items in list

2007-12-06 Thread ted b
Can you suggest a good way to iterate through the remainder of list and update them? Ex: Thing1.value = 0 Thing2.value = 1 Thing3.value = 0 Thing4.value = 0 Things = [Thing1, Thing2, Thing3, Thing4] I want to iterate through 'Things' and if 'Thing.value' > 0, then I want to set all values for th