I have a python script to run several external commands using the os.subprocess module. But one of these steps takes a lot of time, so I would like to run it separately. I need to run them, verify that they are finished, and then run the following command, which is not parallel. My code looks something like this:
nproc = 24 for i in xrange(nproc): #Run program in parallel #Combine files generated by the parallel step for i in xrange(nproc): handle = open('Niben_%s_structures' % (zfile_name), 'w') for i in xrange(nproc): for zline in open('Niben_%s_file%d_structures' % (zfile_name,i)):handle.write(zline) handle.close() #Run next step cmd = 'bowtie-build -f Niben_%s_precursors.fa bowtie-index/Niben_%s_precursors' % (zfile_name,zfile_name)
python
user1598231
source share