import glob, os, re, sys import subprocess import time names = glob.glob('ch*.docbook') for name in names: command="xsltproc html-single.xsl %s > %s.html" %(name ,name.split('.')[0]) print command subprocess.Popen(command,shell=True) time.sleep(10)