From 603337112c471d7ecf1e368d77e1c2f0e71a5dab Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 28 Jan 2014 17:08:48 -0500 Subject: Various fixes --- condor_wrap.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'condor_wrap.py') diff --git a/condor_wrap.py b/condor_wrap.py index 2142c88..0aa25c4 100755 --- a/condor_wrap.py +++ b/condor_wrap.py @@ -15,21 +15,20 @@ def main(): job = [os.path.normpath(args.job)] indata = args.indata - data = [] + output = [] if verbose: print("Job: {}".format(job)) - if isinstance(indata, file): - print("Input:"), - for line in indata.readlines(): - data.append(line) - print(data) - else: - print("Data: {}".format(indata)) - data = indata - compiled = job + data - # print(compiled) - process = subprocess.Popen(compiled) + if isinstance(indata, file): + for line in indata.readlines(): + output.append(line) + else: + output = indata + + compiled = job + output + process = subprocess.Popen(compiled, stdout=sys.stdout, stderr=sys.stderr) + process.communicate() + process.wait() if __name__ == "__main__": -- cgit