alegen

Untitled

May 28th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import os
  2. import sys
  3. from subprocess import Popen, PIPE, STDOUT
  4.  
  5. def runCommand():
  6.     p = Popen(['perl', 'C:\\Programming\\ack.pl', '--type=cc', '"#define"'], shell = True, stdout=PIPE, stderr=PIPE, cwd = 'C:\\Programming\\TestDir')
  7.     while True:
  8.         retcode = p.poll()
  9.         line = p.stdout.read()
  10.         print len(line), line
  11.         if retcode is not None:
  12.             print 'application exited with retcode ' + str(retcode)
  13.             break
  14.  
  15. print 'start'
  16. runCommand()
  17. print 'stop'
Advertisement
Add Comment
Please, Sign In to add comment