if (not hasattr(text1,"属性名")) : print '-1'
めも、詳細未検証
参考
http://www.python.jp/doc/release/library/functions.html?highlight=hasattr#hasattr
http://kjirou.sakura.ne.jp/mt/2009/10/python_hasattrobj_attr_name.html
if (not hasattr(text1,"属性名")) : print '-1'
めも、詳細未検証
参考
http://www.python.jp/doc/release/library/functions.html?highlight=hasattr#hasattr
http://kjirou.sakura.ne.jp/mt/2009/10/python_hasattrobj_attr_name.html