It has been some time since I used Python, but here's my suggestion.
In Python, dictionary values can be of any type (as far as I remember, don't flame me if I'm wrong). At least it should be possible to map your keys to lists.
So you can loop over your dictionaries and maybe create a new dictionary 'd', and for each key, if the value is already in 'd', push the value to the value of 'd' (since the value of the associated key is a list).
Then you can write out the new dictionary as: (pseudocode)
for each key,value in dictionary
write key
write TAB
for each v in value
write v + TAB
write new line
end for
This doesn't include the 'header names' though, but I'm sure that's quite easy to add.