""" /projects/lap/tree/trunk/python/lap/python /projects/lap/tools/trunk/segmentation/nltk_segmenter.py /usit/abel/u1/oe/src/logon/uio/nanc/raw/ws940701.txt /tmp/nltk_segmenter.emanuel.ws940701.rpt /projects/lap/tree/trunk/python/lap/python /projects/lap/tools/trunk/segmentation/repp_tokenizer.py /tmp/nltk_segmenter.emanuel.ws940701.rpt /tmp/repp_tokenizer.emanuel.ws940701.rpt nltk_punkt ptb /projects/lap/tree/trunk/python/lap/python /projects/lap/tools/trunk/tagging/hunpos.py /tmp/repp_tokenizer.emanuel.ws940701.rpt /tmp/hunpos.emanuel.ws940701.rpt eng_wsj.model nltk_punkt repp /projects/lap/tree/trunk/python/lap/python /projects/lap/tools/trunk/parsing/maltparser.py /tmp/hunpos.emanuel.ws940701.rpt /tmp/maltparser.emanuel.ws940701.rpt nltk_punkt repp hunpos /projects/lap/tree/trunk/python/lap/python /projects/lap/tools/trunk/interface/export_tabs.py /tmp/maltparser.emanuel.ws940701.rpt /usit/abel/u1/emanuel/scalability/conll/ws940701.conll """ import sys import os from time import sleep from subprocess import Popen, PIPE n = int(sys.argv[1]) i = int(sys.argv[2]) directory = sys.argv[3] while 1: filenames = [] for dirpath,_,filenames in os.walk(directory): continue if len(filenames) >= n: break else: sleep(0.5) p = Popen(("/projects/lap/tree/trunk/python/lap/python /projects/lap/tools/trunk/segmentation/nltk_segmenter.py /usit/abel/u1/oe/src/logon/uio/nanc/raw/ws940701.txt /tmp/nltk_segmenter.emanuel.ws940701.%s.rpt" % (i)).split(), stdout=PIPE, stderr=PIPE, stdin=PIPE) print p.stdout.read() p = Popen(("/projects/lap/tree/trunk/python/lap/python /projects/lap/tools/trunk/segmentation/repp_tokenizer.py /tmp/nltk_segmenter.emanuel.ws940701.%s.rpt /tmp/repp_tokenizer.emanuel.ws940701.%s.rpt nltk_punkt ptb" % (i, i)).split(), stdout=PIPE, stderr=PIPE, stdin=PIPE) print p.stdout.read() p = Popen(("/projects/lap/tree/trunk/python/lap/python /projects/lap/tools/trunk/tagging/hunpos.py /tmp/repp_tokenizer.emanuel.ws940701.%s.rpt /tmp/hunpos.emanuel.ws940701.%s.rpt eng_wsj.model nltk_punkt repp" % (i, i)).split(), stdout=PIPE, stderr=PIPE, stdin=PIPE) print p.stdout.read() p = Popen(("/projects/lap/tree/trunk/python/lap/python /projects/lap/tools/trunk/parsing/maltparser.py /tmp/hunpos.emanuel.ws940701.%s.rpt /tmp/maltparser.emanuel.ws940701.%s.rpt nltk_punkt repp hunpos" % (i, i)).split(), stdout=PIPE, stderr=PIPE, stdin=PIPE) print p.stdout.read() p = Popen(("/projects/lap/tree/trunk/python/lap/python /projects/lap/tools/trunk/interface/export_tabs.py /tmp/maltparser.emanuel.ws940701.%s.rpt /usit/abel/u1/emanuel/scalability/conll/ws940701.%s.conll" % (i, i)).split(), stdout=PIPE, stderr=PIPE, stdin=PIPE) print p.stdout.read()