#!/usr/bin/env python # ch6-2.py from openeye.oechem import * def MyGetExplicitDegree(atom): result = 0 for bond in atom.GetBonds(): result += 1 return result mol = OEGraphMol() OEParseSmiles(mol, "c1ccccc1") for atom in mol.GetAtoms(): print MyGetExplicitDegree(atom)