Python Selenium
2015年9月2日 星期三
pythonic way to check if something exists?
Easier to ask forgiveness than permission:
try
:
x
except
NameError
:
x_exists
=
False
else
:
x_exists
=
True
reference : http://stackoverflow.com/questions/9390126/pythonic-way-to-check-if-something-exists
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言