2020
10-18
10-18
Python基于locals返回作用域字典
英文文档:locals()Updateandreturnadictionaryrepresentingthecurrentlocalsymboltable.Freevariablesarereturnedbylocals()whenitiscalledinfunctionblocks,butnotinclassblocks.返回当前作用域内的局部变量和其值组成的字典说明:1.函数功能返回当前作用域内的局部变量和其值组成的字典,与globals函数类似(返回全局变量)>>>locals(){'__package__':None,'__loader__':<class'_frozen...
继续阅读 >