我调用这个函数并使用%s*silent
来读取具有以下格式名称的文件:name.number.silent.
我的名字来自start_model.split('/')[-1].split('.')[0]
,所以不用担心。你知道吗
这显然不起作用,因为这些命令实际上从未传递给shell。如果我要使用glob,如何修改代码来执行下面的操作?你知道吗
from subprocess import call
def fragment_score(rosetta_path, silent_input_and_score_output, start_model):
call([rosetta_path,
'-mode score',
'-in::file::silent', '%s/%s*silent' % (silent_input_and_score_output, start_model.split('/')[-1].split('.')[0]),
'-scorefile', '%s/scores1' % silent_input_and_score_output,
'-n_matches', '50'])
使用the Python ^{} module 生成一个glob结果列表,并将其拼接到参数列表中的同一位置,否则将使用一个shell用关联匹配列表替换glob表达式:
在当前的Python3.x中,有一些语法使其更自然:
相关问题 更多 >
编程相关推荐