openbable dockerfile and sample code

This commit is contained in:
2025-10-15 21:09:09 +03:00
parent 742db8a37d
commit 908b2e870d
2 changed files with 90 additions and 0 deletions

15
app.py Normal file
View File

@@ -0,0 +1,15 @@
from openbabel import openbabel
mol = openbabel.OBMol()
print(mol.NumAtoms()) #Should print 0 (atoms)
a = mol.NewAtom()
a.SetAtomicNum(6) # carbon atom
a.SetVector(0.0, 1.0, 2.0) # coordinates
b = mol.NewAtom()
mol.AddBond(1, 2, 1) # atoms indexed from 1
print(mol.NumAtoms()) #Should print 2 (atoms)
print(mol.NumBonds())
mol.Clear();