Skip to content

Instantly share code, notes, and snippets.

@leonardreidy
Created June 26, 2013 19:24
Show Gist options
  • Save leonardreidy/5870696 to your computer and use it in GitHub Desktop.
Save leonardreidy/5870696 to your computer and use it in GitHub Desktop.
A python script that iterates through all of the files in a given directory and runs the previous preproc() function on them.
import os
#get a list of the files in the current directory
a = os.listdir(os.getcwd())
def postproc(a):
#for every file in the directory
for i in a:
#call the preproc function on said file and generate the appropriate outfile
preproc(i, "out"+str(a.index(i))+".txt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment