From c0838d45120b6acec1d412683bb2afe3029ee93d Mon Sep 17 00:00:00 2001 From: David Minton Date: Thu, 29 Aug 2019 09:59:11 -0400 Subject: [PATCH] small change to python driver --- .gitignore | 4 ++++ examples/mare-with-rays-model2/ctem_driver.py | 10 ++++------ python/ctem_driver.py | 10 ++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 02419c52..9c52c7b8 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,7 @@ examples/global-lunar-bombardment/.DS_Store examples/mare-with-rays-model2/.DS_Store examples/mare-with-rays-model2/__pycache__/ + +*.dat + +*.png diff --git a/examples/mare-with-rays-model2/ctem_driver.py b/examples/mare-with-rays-model2/ctem_driver.py index 2936bae4..712a6157 100644 --- a/examples/mare-with-rays-model2/ctem_driver.py +++ b/examples/mare-with-rays-model2/ctem_driver.py @@ -144,11 +144,9 @@ #Create crater population and display CTEM progress on screen print(parameters['ncount'], ' Calling FORTRAN routine') - #proc = subprocess.Popen([parameters['workingdir']+'CTEM'],stdout=subprocess.PIPE,bufsize=1, universal_newlines=True) - #for line in proc.stdout: - # print(line) - #proc.wait() - with subprocess.Popen([parameters['workingdir']+'CTEM'], stdout=subprocess.PIPE, bufsize=1,universal_newlines=True) as p: + with subprocess.Popen([parameters['workingdir']+'CTEM'], + stdout=subprocess.PIPE, + universal_newlines=True) as p: for line in p.stdout: print(line, end='') @@ -228,4 +226,4 @@ #Close updateable fracdonefile and regodepthfile files fp_frac.close() -fp_reg.close() \ No newline at end of file +fp_reg.close() diff --git a/python/ctem_driver.py b/python/ctem_driver.py index 2936bae4..712a6157 100644 --- a/python/ctem_driver.py +++ b/python/ctem_driver.py @@ -144,11 +144,9 @@ #Create crater population and display CTEM progress on screen print(parameters['ncount'], ' Calling FORTRAN routine') - #proc = subprocess.Popen([parameters['workingdir']+'CTEM'],stdout=subprocess.PIPE,bufsize=1, universal_newlines=True) - #for line in proc.stdout: - # print(line) - #proc.wait() - with subprocess.Popen([parameters['workingdir']+'CTEM'], stdout=subprocess.PIPE, bufsize=1,universal_newlines=True) as p: + with subprocess.Popen([parameters['workingdir']+'CTEM'], + stdout=subprocess.PIPE, + universal_newlines=True) as p: for line in p.stdout: print(line, end='') @@ -228,4 +226,4 @@ #Close updateable fracdonefile and regodepthfile files fp_frac.close() -fp_reg.close() \ No newline at end of file +fp_reg.close()