Python-Ref > Cheminformatics > OpenBabel > Generation of images
 
 

<-^^->
Klíčová slova
Moduly
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.
Expand/Shrink
Zdroj: (babel12-1.py)
  1   import pybel
  2   
  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.