Python-Ref > Cheminformatics > OpenBabel > Generation of images

Klíčová slova
Knihovní funkce

Generation of images

To perform the task at hand, openbabel needs help of the OASA library, which has to be installed.
Generation of PNG image of a molecule is very straightforward.
Zdroj: (
  1   import pybel
  3   mol = pybel.readstring("smi","CCC=O")
  4   mol.draw(show=False, filename="butanal.png")
output image butanal.png
Doba běhu: 168.4 ms
Behind the scenes, OASA will both generate coordinates when needed and output the image.