If you really really need to do this:
>>> d = {}
>>> d['test'] = "foo"
>>> locals().update(d)
>>> test
'foo'
But if I were you, I'd try to find a different way of solving the problem you're trying to solve instead of automatically adding variables to your local namespace. There's almost always a way around this mess.