反射


反射py文件中的变量
a = 1
if hasattr(sys.modules['__main__'], 'a'):
print('ll')
原文地址:https://www.cnblogs.com/zhangjian0092/p/12163264.html