为了使程序正常工作,它使用包含以下内容的文件中的代码:
从RunRMSD导入RunRMSD RunRMSD()
来自SumRMSD的导入SumRMSD SumRMSD()
然后它使用包含以下内容的文件(RunRMSD)中的代码:
def RunRMSD():
# get output directory from a threefiles.txt
with open('./threefiles.txt') as fi:
fline = fi.readline()
flist = fline.split('\t')
path_output = flist[1]
import os
command = '/opt/local/bin/pymol -cqr '+'./CalcRMSD.py > '/Users/thanhle/Desktop/output/'RMSD.out'
os.system(command)
不确定我的路径是否正确。
thanhs-MacBook-Pro-2:untitled folder thanhle$ python Director_RMSD.py
Traceback (most recent call last):
File "Director_RMSD.py", line 5, in <module>
RunRMSD()
File "/Users/thanhle/Desktop/ftdock-2-dev2/untitled folder/RunRMSD.py", line 11, in RunRMSD
command = '/opt/local/bin/pymol -cqr '+'./CalcRMSD.py > '/Users/thanhle/Desktop/output/'RMSD.out'
NameError: global name 'Users' is not defined
答案 0 :(得分:0)
“command”变量写得不好:
command = '/opt/local/bin/pymol -cqr '+'./CalcRMSD.py > '/Users/thanhle/Desktop/output/'RMSD.out'
引发错误,因为路径/Users/thanhle/Desktop/output/
未连接,而且您缺少撇号。如果您不想将任何变量解析为该命令,则应该写入:
command = '/opt/local/bin/pymol -cqr ./CalcRMSD.py > /Users/thanhle/Desktop/output/RMSD.out'