var = 123445s= locals()['var']s2=vars()['var']print s,s2
转载于:https://www.cnblogs.com/liguangxu/p/5374548.html