In [ ]:
import rmgpy
from rmgpy.molecule.resonance import *
from rmgpy.molecule.molecule import Molecule

import timeit
from IPython.display import display

In [ ]:
mol1 = Molecule(SMILES='[C]1=C2C=C=C=C3C1=CC3=C2')
display(mol)

In [ ]:
out1 = generateClarStructures(mol1)
out1

In [ ]:
counter = 0
done = False
while not done and counter < 100:
    m = mol1.copy(deep=True)
    num = len(m.getAromaticRings()[0])
    if num == 2:
        done = True
        print counter, m.getAromaticRings()[0]
    else:
        counter += 1

In [ ]:
mol2 = Molecule(SMILES='Cc1c[c]c2C3=C=Cc2c13')
display(m)

In [ ]:
out2 = generateClarStructures(mol2)
out2

In [ ]:
counter = 0
done = False
while not done and counter < 100:
    m = mol2.copy(deep=True)
    num = len(m.getAromaticRings()[0])
    if num == 2:
        done = True
        print counter, m.getAromaticRings()[0]
    else:
        counter += 1

In [ ]: