I want to use a bunch of local variables defined in a function, outside of the function. So I am passing x=locals() in the return value.
x=locals()
How can I load
Rather than create your own object, you can use argparse.Namespace:
argparse.Namespace
from argparse import Namespace ns = Namespace(**mydict)
To do the inverse:
mydict = vars(ns)