#!/usr/bin/env python # ch4-6.py from openeye.oechem import * ifs = oemolistream() ofs = oemolostream() if (ifs.open("drugs.sdf.gz") == 1): if (ofs.open("drugs.oeb.gz") == 1): for mol in ifs.GetOEGraphMols(): OEWriteMolecule(ofs, mol) else: sys.stderr.write("Unable to open output file\n") else: sys.stderr.write("Unable to open input file\n")