Introducing globals() : Global « Language Basics « Python






Introducing globals()

Introducing globals()
# globals() does for the global (module) namespace. 

if __name__ == "__main__": 
    for k, v in globals().items(): 
        print k, "=", v 

           
       








Related examples in the same category

1.Demonstrates global variablesDemonstrates global variables
2.Global variables
3.Use global key word to reference outside global variablesUse global key word to reference outside global variables
4.Local and global Scoping example.Local and global Scoping example.