<- Back | Index | Forward ->

Exceptions

Exceptions indicate that an "exceptional" condition has occured: Why use them?
  try:
    mol = Smiles.smilin("COO")
    atoms = mol.atoms
    atoms[0].addbond(atoms[2])  # Won't work; mod is off!
    mol.cansmiles()
  except DaylightError, msg:
    print "Cannot do that:", msg