我有3個python代碼,我想一個接一個地自動調用,以便它們在單次調用中導致最終結果。 如何將這些代碼包裝到單個腳本中?代碼是model-multiple.py
,align2d.py
,model-single.py
。製作一個包含3個python代碼的腳本
model-multiple.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
那些不是「Python代碼」,它們是Python(程序)文件。代碼是以不明顯的方式映射內容和表示的函數。 – phihag 2011-05-07 12:54:46
@海:單詞「代碼」在英語中有一個以上的含義 – 2011-05-07 13:26:34