Re: [Tutor] Whats so good about OOP ?

2005-03-12 Thread Bill Kranec
Hi Mark, In my brief experience with OOP, I would say that the main advantage is organization of code. All functions and attributes that you need to work with an object are wrapped up nicely inside the object. Also, object inheritance provides a great framework for easy customization. For

Re: [Tutor] Criticism / Suggestions

2005-03-01 Thread Bill Kranec
Hi Kent, First off, thank you so much for the suggestions! They have helped clarify some of the concepts I've been struggling with lately ( mostly object - related ones ). I have been teaching myself Python in my spare time for the last few months, and have no previous programming

[Tutor] Criticism / Suggestions

2005-02-28 Thread Bill Kranec
Hello, So I think that I've 'completed' my first real Python program, and I would appreciate any constructive criticism you all could offer. The program deals with a question that my Dad asked me awhile ago, which was If twelve people want to divide into teams of two and play (golf) against

Re: [Tutor] Method/subclass

2005-02-23 Thread Bill Kranec
This article might also be helpful, as it is a little more concrete: http://www.devx.com/dbzone/Article/22093. I found it by Googling for 'python database access object'. Is this the kind of thing that you are referring to, Kent? HTH, Bill Liam Clarke wrote: Kia ora, I'm not really sure

[Tutor] carriage return on windows

2005-01-29 Thread Bill Kranec
Hello, I'm trying to have a loop in a program print a message so I know it's status. Right now I'm using print Percent completed: + str(percent) + \r Which should send me back to the beginning of the line and overwrite it with a new line. But instead I get: Percent completed: 50 Percent

Re: [Tutor] Advise...

2005-01-26 Thread Bill Kranec
There has been alot of talk on this list about using list comprehensions lately, and this could be one of those useful places. While I don't have time to experiment with real code, I would suggest changing your function to look like: steps = [ min_x + i*delta_x for i in range(steps) ]

[Tutor] flattening a list

2005-01-11 Thread Bill Kranec
Hello, I have a list of lists, for example [ [1,2] , [3,4] ], and I would like to pass all the elements of that list as arguments to a function (for example the intersection of all list elements). Is there a command in regular Python to do this? I would like to avoid the hassle and speed hit

Re: [Tutor] simple list query

2005-01-02 Thread Bill Kranec
You might want to try: x in list this will return true if, for example, list = [x,y,z,w], false if list = [y,y,y,y] Bill Dave S wrote: OK simple query, I have a list consisting of about 250 items, I need to know if a particular item is in the list. I know this is better suited to a