git://git.onelab.eu
/
nepi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cherry picked cb5d027b about context managers
[nepi.git]
/
examples
/
omf
/
testing
/
nepi_omf6_plexus_ping_with_traces.py
diff --git
a/examples/omf/testing/nepi_omf6_plexus_ping_with_traces.py
b/examples/omf/testing/nepi_omf6_plexus_ping_with_traces.py
index
fd507cc
..
01125f3
100644
(file)
--- a/
examples/omf/testing/nepi_omf6_plexus_ping_with_traces.py
+++ b/
examples/omf/testing/nepi_omf6_plexus_ping_with_traces.py
@@
-90,13
+90,11
@@
stdout_2 = ec.trace(app2, "stdout")
# Choose a directory to store the traces, by default
# It it the folder ehere you run Nepi.
# Choose a directory to store the traces, by default
# It it the folder ehere you run Nepi.
-f = open("app1.txt", "w")
-f.write(stdout_1)
-f.close()
+with open("app1.txt", "w") as f:
+ f.write(stdout_1)
-g = open("app2.txt", "w")
-g.write(stdout_2)
-g.close()
+with open("app2.txt", "w") as g:
+ g.write(stdout_2)
# Stop Experiment
ec.shutdown()
# Stop Experiment
ec.shutdown()