How to create a .cdx file from InChI with ChemDraw/Python?
问题 I would like to create a ChemDraw .cdx file from an InChI with Python. This answer gives a solution for cdx --> InChI . The minimal example below cdx_to_inchi works fine, but I could not figure out how I can get inchi_to_cdx to work. import comtypes.client as w32 def cdx_to_inchi(cdx): ChemDraw = w32.CreateObject("ChemDraw.Application") ChemDraw.Visible = False Compound = ChemDraw.Documents.Open(cdx) # opens existing file inchi = Compound.Objects.Data("chemical/x-inchi") print(inchi) ChemDraw