Re: [Tutor] Something I don't understand

2007-12-18 Thread Tiger12506
> Below, "student_seats" is a list of the class "student". > > Why does this code set every student.row to zero when there is only one > student in the list with row > 5? > It still sets them all to zero if I change the test to ">200" when there > are > no student.rows > 200. > But if I change the

Re: [Tutor] detecting a change in a iterable object (list, array, etc.)

2007-12-18 Thread Tim Michelsen
Hello, > A list comprehension will work for this. If data is a list of triples of > (year, month, volume) then this will give you a list of the 1997 triples: > > data1997 = [ item for item in data if item[0]==1997 ] I tried your code out (see below). Here is the output: [] [] [] [] [] [1990,

Re: [Tutor] Something I don't understand

2007-12-18 Thread Remco Gerlich
On Dec 18, 2007 2:44 AM, Jim Morcombe <[EMAIL PROTECTED]> wrote: > Below, "student_seats" is a list of the class "student". How do you create the list? And yes, the naming is confusing, but I believe that only masks the class, it shouldn't cause this problem. Remco Gerlich

Re: [Tutor] detecting a change in a iterable object (list, array, etc.)

2007-12-18 Thread Alan Gauld
"Tim Michelsen" <[EMAIL PROTECTED]> wrote >> A list comprehension will work for this. If data is a list of >> triples of >> (year, month, volume) then this will give you a list of the 1997 >> triples: >> >> data1997 = [ item for item in data if item[0]==1997 ] Note4 that for this to work it a

[Tutor] Application Tutorials

2007-12-18 Thread Michael Schultz
Hello everyone. I'm one of those people stuck in that odd space between total noob and partially competent :) What I'm looking for are nicely structured intermediate tutorials that focus on creating actual applications, even if fairly useless :) But mainly something that can give me an understand

Re: [Tutor] Application Tutorials

2007-12-18 Thread Kent Johnson
Michael Schultz wrote: > What I'm looking for are nicely structured intermediate tutorials that > focus on creating actual applications, even if fairly useless :) But > mainly something that can give me an understanding of how you can > structure an app. Not tutorials, but application skeleton

Re: [Tutor] Something I don't understand

2007-12-18 Thread Eric Brunson
Jim Morcombe wrote: > Below, "student_seats" is a list of the class "student". > > Why does this code set every student.row to zero when there is only one > student in the list with row > 5? > It still sets them all to zero if I change the test to ">200" when there are > no student.rows > 200. >

[Tutor] Required method to make foo(*Vector(0,0,0)) work.

2007-12-18 Thread Adam Bark
I want to be able to get the values for my vector class but I don't know what method you need to get the * thing to work ie how to make it a sequence i think. Anybody know how to do this? Thanks in advance. ___ Tutor maillist - Tutor@python.org http://m

[Tutor] MAKING MONEY WITH OUR PYTHON CODE-A YULE GIFT TO ALL

2007-12-18 Thread Kirk Bailey
OK, who's a large customer base? Folk i the world running around with laptops, non geek business folk. they knowfrom Adam when it comes to hand installing code. So when we write things hard to install, who buys it? not very many. A few geeks maybe. So we need to make our code easy to install and

Re: [Tutor] Required method to make foo(*Vector(0,0,0)) work.

2007-12-18 Thread Kent Johnson
Adam Bark wrote: > I want to be able to get the values for my vector class but I don't know > what method you need to get the * thing to work ie how to make it a > sequence i think. Anybody know how to do this? I'm not a very good mind reader! What vector class are you talking about? What are y

Re: [Tutor] Required method to make foo(*Vector(0,0,0)) work.

2007-12-18 Thread John Fouhy
On 19/12/2007, Adam Bark <[EMAIL PROTECTED]> wrote: > I want to be able to get the values for my vector class but I don't know > what method you need to get the * thing to work ie how to make it a sequence > i think. Anybody know how to do this? > Thanks in advance. If you're confused about python

Re: [Tutor] Required method to make foo(*Vector(0,0,0)) work.

2007-12-18 Thread Adam Bark
On 19/12/2007, John Fouhy <[EMAIL PROTECTED]> wrote: > > On 19/12/2007, Adam Bark <[EMAIL PROTECTED]> wrote: > > I want to be able to get the values for my vector class but I don't know > > what method you need to get the * thing to work ie how to make it a > sequence > > i think. Anybody know how

[Tutor] Placing entire Application inside a class

2007-12-18 Thread Jim Morcombe
I have just read through "Creating a GUI in Python - by Dakota Lemaster" In it, Dakota recomends placing the entire application within a class. Why is this so? Surely in many cases you end up with a constructor for the class that is cumbersome and complex? Is this a recomended Python programmi

Re: [Tutor] Required method to make foo(*Vector(0,0,0)) work.

2007-12-18 Thread Tiger12506
> Sorry I wasn't quite sure how to explain it it's a vector class i've > written > myself. > I've worked it out now, I was using a vector as part of a quaternion and > wanted to > be able to pass a vector or individual numbers so it seemed the easiest > way > to be > able to use the *sequence syn

Re: [Tutor] Placing entire Application inside a class

2007-12-18 Thread Tiger12506
It is helpful for GUI applications because of what it says about halfway down the page, within __init__ you can bind certain messages to methods of the class. I would not say that it is recommended persé but I'm sure that there are those out there that cannot write a program without putting it