openbable dockerfile and sample code
This commit is contained in:
15
app.py
Normal file
15
app.py
Normal 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();
|
||||
Reference in New Issue
Block a user