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)