I'm saying the "keys" are always the same for a
Now I have a dict of those keys to their values and can do whatever I want with it.
sys.version_info
object. So if you have such an object you just zip the values with the known "keys".>>> import sys >>> fields = ["major", "minor", "micro", "releaselevel", "serial"] >>> dict(zip(fields, sys.version_info)) {'micro': 11, 'major': 2, 'releaselevel': 'final', 'serial': 0, 'minor': 7}You don't need to parse out the keys if you already know what they are...
Now I have a dict of those keys to their values and can do whatever I want with it.