我想在函数外部使用函数中定义的一堆局部变量.所以我传递x=locals()了返回值.
x=locals()
如何将该字典中定义的所有变量加载到函数外部的命名空间中,这样x['variable']我就可以简单地使用,而不是使用值来访问该值variable.
x['variable']
variable
python variables scope locals
locals ×1
python ×1
scope ×1
variables ×1