Python built-in functions (26) -- globals, pythonglobals

Source: Internet
Author: User

Python built-in functions (26) -- globals, pythonglobals

English document:

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 ).
Note:
1. Return the dictionary of global variables in the current scope.
>>> Globals () {'_ spec _': None, '_ package _': None, '_ builtins __': <module 'builtins '(built-in)>,' _ name _ ':' _ main _ ',' _ doc _ ': None, '_ loader _': <class '_ frozen_importlib.BuiltinImporter' >}>> a = 1 >>> globals () # An additional a {'_ spec _': None, '_ package _': None, '_ builtins __': <module 'builtins '(built-in)>, 'A': 1,' _ name _ ':' _ main __', '_ doc _': None, '_ loader _': <class '_ frozen_importlib.BuiltinImporter'>}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.