tuple unpacking

jhsieh jhsieh at jpl.nasa.gov
Wed Jun 4 18:02:41 EDT 2003


hi,
i'm trying to return a tuple of values from a class method, and here is 
the error i get:
> Traceback (most recent call last):
>   File "./Sequencer.py", line 240, in ?
>     TheSequencerGUI = Sequencer(TheNameService, TheRootWindow)
>   File "./Sequencer.py", line 58, in __init__
>     FDLControl, self.CatalogSubsystem)
>   File "./Sequencer.py", line 188, in InitSubsystem
>     self.Config, *Config)
>   File "./FDLControl.py", line 23, in __init__
>     self.TextDisplay)
>   File "./SubsystemControl.py", line 25, in __init__
>     self.Controls, self.Buttons = self.InitGUI(self)
> TypeError: unpack non-sequence

The code is:
...
self.Controls, self.Buttons = self.InitGUI(self)
...

def InitGUI(self, TheFrame):
...
	TheControls = Pmw.Group(self, tag_text=self.SubsystemName,\
         	                ring_borderwidth=4)
	TheButtons = Pmw.ButtonBox(TheControls.interior())
	TheButtons.add("On", command=self.On)
	TheButtons.add("Halt", command=self.Halt)
	TheButtons.add("ReInit", command=self.ReInit)
	TheButtons.add("Off", command=self.Off)
	TheButtons.pack(fill=X)
	TheControls.pack(fill=X)

	return TheControls, TheButtons

Thanks in advance!!

~Jon





More information about the Python-list mailing list