您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Python内置globals函数的详细介绍

2024/6/30 16:41:17发布45次查看
英文文档:
globals()
return a dictionary representing the current global symbol table. this is always the dictionary of the current module (inside a function or method, this is the module where it is defined, not the module from which it is called).
说明:
1. 返回当前作用域内全局变量的字典。
>>> globals() {'__spec__': none, '__package__': none, '__builtins__': <module 'builtins' (built-in)>, '__name__': '__main__', '__doc__': none, '__loader__': <class '_frozen_importlib.builtinimporter'>} >>> a = 1 >>> globals() #多了一个a {'__spec__': none, '__package__': none, '__builtins__': <module 'builtins' (built-in)>, 'a': 1, '__name__': '__main__', '__doc__': none, '__loader__': <class '_frozen_importlib.builtinimporter'>}
以上就是python内置globals函数的详细介绍的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product