I need to check certain attributes for existence. Like:
if "blah-blah-blah" is None:
print "there is no such attribute"
else:
print "The attribute exists"
I need to check certain attributes for existence. Like:
if "blah-blah-blah" is None:
print "there is no such attribute"
else:
print "The attribute exists"
Element
objects have all the attributes in the attrib
dict.
if 'blah' not in elem.attrib:
print "there is no such attribute"
© 2022 - 2024 — McMap. All rights reserved.
else
... – Engagedwhatever == None
, should be writtenwhatever is None
– Anastice