def make_jobs(commands, job_prefix, queue, jobs_dir='jobs/', walltime='72:00:00', ncpus=1, nodes=1, keep_output='oe'):
 filenames = []
 create_dir(jobs_dir)
 for command in commands:
  (fd, job_name) = mkstemp(dir=jobs_dir, prefix=(job_prefix + '_'), suffix='.txt')
  close(fd)
  out_fh = open(job_name, 'w')
  out_fh.write((QSUB_TEXT % (walltime, ncpus, nodes, queue, job_prefix, keep_output, command)))
  out_fh.close()
  filenames.append(job_name)
 return filenames

def make_jobs ( commands , job_prefix , queue , jobs_dir = 'jobs/' , walltime = '72:00:00' , ncpus = 1 , nodes = 1 , keep_output = 'oe' ) : filenames = [ ] create_dir ( jobs_dir ) for command in commands : ( fd , job_name ) = mkstemp ( dir = jobs_dir , prefix = ( job_prefix + '_' ) , suffix = '.txt' ) close ( fd ) out_fh = open ( job_name , 'w' ) out_fh . write ( ( QSUB_TEXT % ( walltime , ncpus , nodes , queue , job_prefix , keep_output , command ) ) ) out_fh . close ( ) filenames . append ( job_name ) return filenames
prepare qsub text files .