英文文档: locals() Update and return a dictionary representing the current local symbol table. Free variables are returned by locals()when it is called in function blocks, but not in class blocks. 返回当前作用域内的局部变量和其值组成的字典 说明: 1. 函数功能返回当前作用域内的局部变量和其值组成的字典,与globals函数类似(返回全局变量) >>> locals() {'__package__