#-*-coding:utf-8-*-"""Created on Sat June 19:36:34 2015@author:chaofn"""ImportOS"""The purpose of this program is to batch all files in the/ifs/home/fanchao/manesh_pdb directory (a total of 215 files) from Linux to generate a PDB file DSSP file"""#Listdir Returns a list of file namesFileline=os.listdir ('/ifs/home/fanchao/manesh_pdb')#traverse the entire list forIinchRange (len (fileline)-1): #to represent a string in a variableinput_file='/ifs/home/fanchao/manesh_pdb/'+Fileline[i]#first remove the suffix of the file name and then form a filename with the suffix DSSPOut_file=fileline[i].split ('.') [0]+'. DSSP'output_file='/ifs/home/fanchao/manesh_dssp/'+Out_file#Note: The parameter is passed (first%s, then the% variable name), and multiple variables are passed in a tuple, with% in front of the tupleOs.system ('/ifs/share/lib/dssp/dssp2-i%s-o%s'% (Input_file,output_file))
Python batch Processing