python 判断变量有没有定义


?

1
2
'varname' in locals().keys()
'varname' in  dir()
posted @ 2016-07-25 16:48  aaron_agu  阅读(2671)  评论(0编辑  收藏  举报