try catch - Python trying fails -
i trying in python.
try: newbutton['roundcornerradius'] = buttondata['roundcornerradius'] buttons.append(newbutton)
buttons list. roundcornerradius optional in buttondata.
alas gives
buttons.append(newbutton) ^ syntaxerror: invalid syntax
i want ignore cases roundcornerradius not exist. don't need error reported.
why arent using except
keyword
try: newbutton['roundcornerradius'] = buttondata['roundcornerradius'] buttons.append(newbutton) except: pass
this try first part , if error thrown except part
you can add disered error want except error this
except attributeerror:
you can excepted error doing this:
except exception,e: print str(e)
Comments
Post a Comment