Need call by Name or any other solution...!?!

Th. Heidenreich python at heidenreichs.de
Tue Nov 13 20:31:58 EST 2001


Hi,

I´ve got the following problem: I want to assign a number of variables
(which are not constant) a value by an entry box. Better look at the
code:


def confirm(self):
	print self.right

def __init__(self, nof_entries, categories):
	self.right = []
	for i in range(nof_entries):
		list_label = Label(text = categories[i], relief="flat")
		list_label.grid( row = i+2  , column = 0)
		self.right.append(chr(65+i))  # just to have something in there
		right_label.append(Entry( relief = "sunken", bd = 2, textvariable =
self.right[i]))  # **** THATS THE THING THAT DOSN´T WORK   ****
		right_label[i].grid(row = i+2  , column = 1)
	
	b_confirm = Button(text = "Confirm", command = self.confirm)
	b_confirm.grid(row = laenge+3, column = 0, columnspan = 2)

...


self.right[0] for example refers to a variable named "A" - but it
should refer to a variable CONTAINING "A", so how can I assign a
textvariable to an entry of an array?? Or has anyone another idea how
to do this???


Hope anyone can help, the skript has to be finished by Friday :((

thanks
 Thomas


ps: If possible please answer cc: python at thomas-heidenreich.net



More information about the Python-list mailing list