Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- from subprocess import Popen, PIPE, STDOUT
- def runCommand():
- p = Popen(['perl', 'C:\\Programming\\ack.pl', '--type=cc', '"#define"'], shell = True, stdout=PIPE, stderr=PIPE, cwd = 'C:\\Programming\\TestDir')
- while True:
- retcode = p.poll()
- line = p.stdout.read()
- print len(line), line
- if retcode is not None:
- print 'application exited with retcode ' + str(retcode)
- break
- print 'start'
- runCommand()
- print 'stop'
Advertisement
Add Comment
Please, Sign In to add comment