ValueError: too many values to unpack Tkinter Listbox
Question: When writing a simple program to output the values and keys in a dictionary to
a listbox in python using Tkinter I get the following error:

    
    
        for key, value in mydict.itervalues():
    ValueError: too many values to unpack
    

Please see my code below:

    
    
    #!/usr/bin/python
    
    import Tkinter as tk
    
    
    mydict = {"0x00063":"6F 7D 9E 0E FF FF FF FF", 
              "0x00061":"FF FF FF FF FF FF FF FF", 
              "0x00062":"AA AA AA AA AA AA AA AA", 
              "0x00064":"00 00 00 00 00 00 00 00"}
    
    guiMain = tk.Tk()
    recvDisplay = tk.Listbox(guiMain)
    
    for key, value in mydict.itervalues():
        recvDisplay.insert(key, value)
    
    recvButton = tk.Button(guiMain, text="Start Receive")
    tranDisplay = tk.Listbox(guiMain)
    tranButton = tk.Button(guiMain, text="Start Transmit")
    recvDisplay.pack()
    recvButton.pack()
    tranDisplay.pack()
    tranButton.pack()
    guiMain.mainloop()
    

I need to be able to output the values and keys within to dictionary to the
listbox `recvDisplay`, but I need the listbox to automatically refresh so it
displays any changes to the dict.


Answer: [`mydict.itervalues()`](https://docs.python.org/2/library/stdtypes.html#dict.itervalues)
is an iterator over the values in `mydict`. If you want both the keys and the
values, use
[`mydict.iteritems()`](https://docs.python.org/2/library/stdtypes.html#dict.iteritems):

    
    
    for key, value in mydict.iteritems():
        recvDisplay.insert(tk.END, '{}, {}'.format(key, value))
    

Note: A Listbox only has one column. If you want multiple columns to display
the key and value separately, you will need a different widget, such as a
[treectrl.MultiListbox](http://stackoverflow.com/q/5286093/190597), or put two
`Listboxes` side-by-side.

