0
我试图调用外部程序(Openbabel)给分子列表(SMILES格式)中的每个元素(分子)。然而,我一直得到相同的错误:对列表中的每个元素运行外部程序
/bin/sh: 1: Syntax error: "(" unexpected (expecting ")").
我的代码有什么问题?
from subprocess import call
with open('test_zinc.smi') as f:
smiles = [(line.split())[0] for line in f]
def call_obabel(smi):
for mol in smi:
call('(obabel %s -otxt -s %s -at %s -aa)' % ('fda_approved.fs', mol, '5'), shell=True)
call_obabel(smiles)