On 6/19/2020 11:16 AM, C Anthony Lewis wrote:
...
   File "smog.py", line 16, in smog2mol
     atm.SetAtomicNum(ob.cvar.etab.GetAtomicNum(element))
AttributeError: Unknown C global variable 'etab'

ob.cvar.etab.GetAtomicNum(element) looks like you're trying to access the element table via some table of "global" objects. Instead, fetch it someplace higher up in the code using the "proper" accessor function and save it in a variable, then use that variable.

This should work (last I looked):

etab =  openbabel.OBElementTable()
...
atm.SetAtomicNum( etab.GetSymbol( element ) )

(assuming "element" is OK of course).

Dimitri


_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to