2009/12/2 aoife <aoife...@hotmail.com>: > Hi,very new.hoping to incorporate python into my postgrad. > > Basically I have 2,000 files.I want to write a script that says: > > open each file in turn
If they are in one directory, look at the glob module. If they are in a bunch of sub-directories, see os.walk(), or <http://bit.ly/5Q5Qiv>. For looping through the files, see <http://bit.ly/4zvi9P>. > for each file: > open this pbs script and run MUSCLE (a sequence alignment tool) > on each file Is MUSCLE a command-line tool? If so, see the subprocess module. > close this file Do you actually need to open the file, or just run a command on it? Sounds like the latter to me. > move on to next file. Give it a go. Any problems, I'm sure we'd be happy to help. -- Cheers, Simon B. -- http://mail.python.org/mailman/listinfo/python-list