Re: variables of the class are not available as default values?

2009-08-27 Thread seanacais
On Aug 27, 5:44 pm, Chris Rebert wrote: > On Thu, Aug 27, 2009 at 2:37 PM, seanacais wrote: > > I'm working on a program where I wish to define the default value of a > > method as a value that was set in __init__.  I get a compilation error > > saying that self is un

variables of the class are not available as default values?

2009-08-27 Thread seanacais
I'm working on a program where I wish to define the default value of a method as a value that was set in __init__. I get a compilation error saying that self is undefined. As always a code snippet helps :-) class foo: def __init__(self, maxvalue): self.maxvalue = maxvalue sel

finding the parent class (not superclass) of the currently executing method derived from a Borg class

2008-09-08 Thread seanacais
I want to create a class derived from a Borg class that can instantiated as part of a script or be contained in other classes. When methods from the Borg class are called, I would like to know the name of the class that contains the Borg class. I've played a bit with inspect and _getframe from th

Re: Using StringVars in List of Dictionaries as tkInter variables for Scale and Label widgets

2008-05-20 Thread seanacais
On May 20, 2:40 am, Peter Otten <[EMAIL PROTECTED]> wrote: > seanacais wrote: > > You have to ensure that the lines > > from Tkinter import * > root = Tk() > > are *executed* before the line > > dname = dict((d, StringVar()) for d in OPDefaults) > > Peter

Re: Using StringVars in List of Dictionaries as tkInter variables for Scale and Label widgets

2008-05-19 Thread seanacais
On May 19, 2:11 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > > There's some magic going on behind the scene which means that you have to > create a Tkinter.Tk instance before you can start churning out StringVars: > > >>> import Tkinter as tk > >>> v = tk.StringVar() > > Traceback (most recent call

Using StringVars in List of Dictionaries as tkInter variables for Scale and Label widgets

2008-05-19 Thread seanacais
I'm trying to build an unknown number of repeating gui elements dynamically so I need to store the variables in a list of dictionaries. I understand that Scale "variable" name needs to be a StringVar but I cannot figure out how to initialize the dictionary. I've tried the following code ps =