Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
small change to python driver
  • Loading branch information
daminton committed Aug 29, 2019
1 parent c0719d4 commit c0838d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 4 additions & 6 deletions examples/mare-with-rays-model2/ctem_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='')

Expand Down Expand Up @@ -228,4 +226,4 @@

#Close updateable fracdonefile and regodepthfile files
fp_frac.close()
fp_reg.close()
fp_reg.close()
10 changes: 4 additions & 6 deletions python/ctem_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='')

Expand Down Expand Up @@ -228,4 +226,4 @@

#Close updateable fracdonefile and regodepthfile files
fp_frac.close()
fp_reg.close()
fp_reg.close()

0 comments on commit c0838d4

Please sign in to comment.