I would like to collect the installed packages and their versions of hosts to create a grid. The hosts don't necessarily have the same packages. For example:
In the first step I would like to simple store, and print these values. What data structure should I use?
I would like to store the data somehow liek this:
for ..
# read values
versions[package][host] = version
I would like to print the values somehow like this:
for packagename in packagenames
print packagename + ": "
for host in hosts
if versions[host][package] is not None
print versions[host][package]
print ";"
print "\n"
But because I don't know how many packages are there, and not all packages are exist in every host, I'm not sure how to do this. I guess I should use dictionary, but I'm don't know how.