反射


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