Python batch Processing

Source: Internet
Author: User

#-*-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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.