<filename>base_syntax/variable_action_scope.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# added by kangye python27

import data_type
from utils import *

sex = 20
author = data_type.author
def testLocalVar():
    name = 'hello'
    # global sex
    sex = 30
    print locals()
    print  globals()
    return;

if __name__ == "__main__":

    testLocalVar()
    print sex
    print dir()
    print __file__
    print Math.add(2,3)
    print DateUtil.printTime()
    print var_init_ # the global variable
    #data_type.printSplit("hello, kevin")
else:
    #
    print "it is exce by other mouder"
<filename>base_syntax/variable_action_scope.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# added by kangye python27

import data_type
from utils import *

sex = 20
author = data_type.author
def testLocalVar():
    name = 'hello'
    # global sex
    sex = 30
    print locals()
    print  globals()
    return;

if __name__ == "__main__":

    testLocalVar()
    print sex
    print dir()
    print __file__
    print Math.add(2,3)
    print DateUtil.printTime()
    print var_init_ # the global variable
    #data_type.printSplit("hello, kevin")
else:
    #
    print "it is exce by other mouder"
#!/usr/bin/python # -*- coding: UTF-8 -*- # added by kangye python27 # global sex # the global variable #data_type.printSplit("hello, kevin") #