still making both branches closer
[nepi.git] / examples / linux / ccn_transfer_using_linuxapp.py
index 0395a40..8bf7cfc 100644 (file)
@@ -118,7 +118,7 @@ def add_ccnd(ec, peers):
 
     # BASH command -> ' ccndstart ; ccndc add ccnx:/ udp  host ;  ccnr '
     command = "ccndstart && "
-    peers = map(lambda peer: "ccndc add ccnx:/ udp  %s" % peer, peers)
+    peers = ["ccndc add ccnx:/ udp  %s" % peer for peer in peers]
     command += " ; ".join(peers) + " && "
     command += " ccnr & "
 
@@ -207,9 +207,8 @@ apps = [ccncat]
 ec.wait_finished(apps)
 
 stdout = ec.trace(ccncat, "stdout")
-f = open("video.ts", "w")
-f.write(stdout)
-f.close()
+with open("video.ts", "w") as f:
+    f.write(stdout)
 
 # Shutdown the experiment controller
 ec.shutdown()