Created
July 23, 2017 16:37
-
-
Save june9713/e9e19a0993cc4006ac17d834dc7dc2a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import subprocess | |
import threading | |
import os | |
#### test.py ######## | |
#import sys | |
#print("path is " , sys.argv[1]) | |
#print("This is test") | |
##################### | |
process = '' | |
def checkPout(): | |
global process | |
while True: | |
out = process.stdout.read(1) | |
if out == b'' and process.poll() != None: | |
break | |
if out != b'': | |
sys.stdout.write(out.decode()) | |
sys.stdout.flush() | |
yourpath = os.getcwd() | |
cmd ="python test1.py --path=%s"%(yourpath) | |
process = subprocess.Popen(cmd,stdout = subprocess.PIPE,stderr = subprocess.PIPE,shell=True) | |
th = threading.Thread(target= checkPout ) | |
th.start() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment