[Tutor] class overriding question

2004-12-18 Thread Brian van den Broek
Hi all, instead of sleeping, I've been up all night finally attacking my apprehension about classes. I think I'm mostly getting the hang of it -- I managed to convert a 300 line procedural script into (what I think is) a fully object-oriented approach. :-) I made a lot of use of Mark Pilgrim's Di

Re: [Tutor] class overriding question

2004-12-18 Thread Kent Johnson
Yup, that's right! Attribute access (the dot operator '.') is an operation that happens at runtime, and each attribute access stands alone. Every attribute access goes through the same search path, starting with self, then the class (type) of self, finally the base classes. So, in your example, s

Re: [Tutor] Tkinter questions

2004-12-18 Thread Mark Kels
> I find the easiest way is to create an PhotoImage object attach > the graphic file(jpg,bmp,gif) to that and assign the PhotoImage > object to the Button.image property. You can "animate" the image > by simply reassigning the file to the underlying PhotoImage onject. Thanks, but a practical expla

Re: [Tutor] class overriding question

2004-12-18 Thread Brian van den Broek
Kent Johnson said unto the world upon 2004-12-18 08:53: Yup, that's right! Attribute access (the dot operator '.') is an operation that happens at runtime, and each attribute access stands alone. Every attribute access goes through the same search path, starting with self, then the class (type)

Re: [Tutor] Difference between for i in range(len(object)) andfor iin object

2004-12-18 Thread Jacob S.
> Thing is, for people like me, you generally either don't know that a > question is a dumb one until someone tells you the answer, (the 'of > course' moment), or until 5 minutes after you emailed > your query, you find the answer you were looking for... Amen! My life's story! Also, to Kumar. T

Re: [Tutor] Python 2.4 IDLE Windows 2000

2004-12-18 Thread Jacob S.
Gee, I think I'm going to burst out in tears. Mike Hansen gave the solution to the very problem I'm having, yet, when I used the console version and deleted the custom color theme, it stopped giving me error messages, but it still won't start up without the console. I'm am still stunted of my pyth

Re: [Tutor] "TypeError: 'int' object is not callable"??

2004-12-18 Thread Jacob S.
Thanks for the explanation! Jacob Schmidt > Jacob S. wrote: > > Thank you! > > > > Wait, though. > > > > How do I do this? > > > > def differentnoofvars(*args,**kwargs): ## By the way, is it **kwargs or > > **kwds? > > Call it what you like, it's an ordinary function parameter. kwds is commonly

[Tutor] Mainframe experience

2004-12-18 Thread David Holland
Sadly in my IT company (which I better not name), mainframe experience seems to be a route to redundancy ! Fortunately I work with Oracle. === message truncated === ___ ALL-NEW Yahoo! Messenger - all ne

Re: [Tutor] Re: A simpler mousetrap

2004-12-18 Thread Jacob S.
Also, just as interesting, yet probably less reliable: a = list(a) a[-3:] = 'bak' a = "".join(a) OR a = a.rstrip('pct') a = a+'bak' OR a = a.rstrip('pct')+'bak' ## Which is essentially the same thing OR a = a[:-3]+'bak' ETC. HTH, Jacob > x=os.path.splitext(a)[0]+'.bak' > > Ah, jolly good

Re: [Tutor] Vpython

2004-12-18 Thread Jacob S.
> > I was wondering were can I find some Vpython graphics program codes that are readily available. I have 2 that I am proud of. A simple function grapher Usage: >0.125*x**2 Graphs y = 1/8*x**2 >y = 1/x Graphs y = 1/x >clear Clears display window >r = t**2 Graphs polar function r = t**2 >

Re: [Tutor] Nifty

2004-12-18 Thread Jacob S.
I probably wouldn't be any help on projects, but I would probably learn stuff from it. I'm okay with it. Jacob Schmidt > >> I just got in contact with Nick Parlante of the Nifty > >> Assignments project; he's been collecting material on fun > >> projects: > >> > >> http://nifty.stanford.edu/ > > >

Re: [Tutor] least squares

2004-12-18 Thread Jacob S.
Hey, now. I know that some of us are newbies to python, but that doesn't mean that we're all newbies to math concepts. (Even advanced ones.) Having said that, I will shut my fat mouth now because it will be my luck that the math is beyond what I can handle. I wouldn't mind seeing the code. Even if

Re: [Tutor] Nifty

2004-12-18 Thread Brian van den Broek
Jacob S. said unto the world upon 2004-12-18 21:06: I probably wouldn't be any help on projects, but I would probably learn stuff from it. I'm okay with it. Jacob Schmidt I just got in contact with Nick Parlante of the Nifty Assignments project; he's been collecting material on fun projects: http:

Re: [Tutor] listing all combinations of elements of a list

2004-12-18 Thread Jacob S.
Am I wrong, or is that what the module sets is for? I don't remember if python 2.3 has it, but python2.4 has it available. >>> import sets >>> s = sets.Set >>> a = s([1,2,3]) >>> a Set([1, 2, 3]) >>> a.update([1,1,2,2,3,3,4,4,5,5]) >>> a Set([1, 2, 3, 4, 5]) >>> HTH, Jacob Schmidt > > def combin

Re: [Tutor] Nifty

2004-12-18 Thread Chad Crabtree
I think it's a great idea, I would like to participate also. Brian van den Broek wrote: > Jacob S. said unto the world upon 2004-12-18 21:06: > >> I probably wouldn't be any help on projects, but I would probably learn >> stuff from it. >> I'm okay with it. >> Jacob Schmidt >> >> > I just got