IndentationError?

这个错误通常是由于代码缩进不正确导致的。在 Python 中,缩进是非常重要的,因为它决定了代码块的范围。

在上面的代码中,错误提示指出在第二行缺少缩进。因此,我们需要在 for 循环后面添加一个缩进,以指示该循环的代码块。修正后的代码如下:

writer = Chem.SDWriter('GRA_confs.sdf')
for conf in mol.GetConformers():
    writer.write(mol, confId=conf.GetId())

这样就可以解决 IndentationError 错误了。

writer = ChemSDWriterGRA_confssdf for conf in molGetConformers writerwritemol confId=confGetId File stdin line 2 writerwritemol confId=confGetId ^IndentationError expected an indented block aft

原文地址: http://www.cveoy.top/t/topic/eglV 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录