【发布时间】:2018-01-11 00:42:39
【问题描述】:
我正在尝试为分子列表(SMILES 格式)中的每个元素(分子)调用外部程序(Openbabel)。但是,我不断收到同样的错误:
/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)
【问题讨论】:
标签: python subprocess call openbabel