import __main__
d = dict((x, __main__.__dict__[x]) for x in list_of_variable_names)
Given a list of variable names in Python, how do I a create a dictionary with the variable names as keys (to the variables' values)?