Python 2.7.9 Demo

#coding=utf-8
#!/usr/bin/python

def setConfig():
    hello = 'world';
    print 'The value has been setted.';
    return hello;
    
hello_cp = setConfig();
print 'print outside : ' + hello_cp;
#coding=utf-8
#!/usr/bin/python

def setConfig():
    dict = {'username' : 'nick huang', 'age' : 18};
    print 'The value has been setted.';
    return dict;
    
dict_cp = setConfig();
print 'print outside : ';
for key in dict_cp.keys():
    print dict_cp[key];
原文地址:https://www.cnblogs.com/nick-huang/p/4617324.html