Advertisement
Guest User

Untitled

a guest
May 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. from sys import argv
  2. from subprocess import Popen
  3.  
  4. processes = []
  5. maxP = 2
  6.  
  7. for in_file in argv[1:]:
  8.     out_file = ".".join(in_file.split(".")[:-1])+".html"
  9.     task = "cuneiform -l ruseng -f html -o {1} {0}".format(in_file, out_file)
  10.     task = task.split()
  11.     if len(processes)>=maxP:
  12.         for proc in processes:
  13.             proc.wait()
  14.         processes = []
  15.     print("Processing "+in_file)
  16.     processes.append(Popen(task))
  17. print("All Done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement