反射


反射py文件中的变量
a = 1
if hasattr(sys.modules['__main__'], 'a'):
print('ll')
posted @ 2020-01-07 19:09  眼镜儿  阅读(96)  评论(0)    收藏  举报