Python Func Globals
# Python2.x Python globals() Function
[ Python Built-in Functions](#)
* * *
## Description
The **globals()** function returns a dictionary containing all global variables at the current location.
## Syntax
globals() function syntax:
globals()
## Parameters
* None
## Return Value
Returns a dictionary of global variables.
## Example
The following example demonstrates the usage of globals():
>>>a=''>>>print(globals())# globals function returns a dictionary of global variables, including all imported variables. {' __builtins__ ': , ' __name__ ': ' __main__ ', ' __doc__ ': None, 'a': '', ' __package__ ': None}
[ Python Built-in Functions](#)
YouTip