我有3个python代码,我想一个接一个地自动调用,这样它们就可以在s单次调用中得到最终结果。
如何将这些代码包装成单个脚本?代码是model-multiple.py
,align2d.py
,model-single.py
。在
型号-多个.py是
from modeller import * # Load standard Modeller classes
from modeller.automodel import * # Load the automodel class
log.verbose() # request verbose output
env = environ() # create a new MODELLER environment to build this model in
env.io.atom_files_directory = ['.', '../atom_files']
a = automodel(env,
alnfile = '3NTD_align.ali', # alignment filename
knowns = ('3NTDA'),
sequence = 'target', # code of the target
assess_methods=(assess.DOPE, assess.GA341,assess.normalized_dope))
a.starting_model= 1 # index of the first model
a.ending_model = 1 # index of the last model
# (determines how many models to calculate)
a.make() # do the actual homology modeling
您可能应该考虑以一种方便从其他脚本调用和直接调用的方式组织脚本。一般模式是:
您有两种选择:
system
或{如果这三个脚本都与您的示例相似,则可以使用下面的Python脚本逐个运行它们:
^{pr2}$__import__
是必需的,因为连字符(-)在导入名称中是非法的。如果您愿意重命名脚本:相关问题 更多 >
编程相关推荐