Yes, you are tring to assign to two variabels but levelDict is a single
object, a dictionary with a single element which is another
dictionary. If, as I assume, nm and dt (very poor variable names,
especially when you are asking others to help you debug) refer to name
and data by which you mean key and value from the dictionary then
perhaps you really want this.
for key, val in levelDict.items():
...
--
D'Arcy J.M. Cain <da...@druid.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
What do you mean by "doesn't seem to throw any errors in the
interpreter?" Can't you see the IndentationErrors above?!?
IndentationErrors *are* errors!
A for-loop needs to have at least one statement inside the suite after
the colon. You're not putting any statements after the colon, and that's
why Python is throwing the same error in either case.
Because you're not entering syntactically correct code, the interpreter
session never even gets around to iterating over the dictionary, so your
session dies before it gets a chance to reproduce the error you're
looking for. If you put a dummy "pass" statement into the loop, you'll
reproduce the ValueError you're trying to troubleshoot:
>>> d = {'cat': {'one':'two'}}
>>> for a, b in d:
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: too many values to unpack
As far as what's causing this error, I already explained that two weeks
ago: http://groups.google.com/group/comp.lang.python/msg/b9e02a9a9b550ad3
The fact that you're still struggling with this error is deeply
disturbing to me.
--
Carsten Haese
http://informixdb.sourceforge.net
That may be so, but you cleverly disguised this fact by saying the exact
opposite.