这里说脚本应该在 pymol 命令行中使用。我想在阅读后使用循环输出许多距离。但我收到错误消息:
File "<string>", line 1
for i in range(resi_total_n):
^
SyntaxError: unexpected EOF while parsing
我的代码是:
from pymol import cmd
mol_name='name'
resi=10 # the target residue number
resi_total_n=500 # the total residue number
f=open('dist.txt','w')
resi_n=0
for i in range(resi_total_n):
resi_n += 1
dst=cmd.distance('tmp',mol_name+'///'+str(resi)+'/ca',mol_name+'///'+str(resi_n)+'/ca') #the alpha carbon
f.write("%8.3f\n"%dst)
f.close()