X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=examples%2Flinux%2Fccn_transfer_using_linuxapp.py;h=8bf7cfc066cc5236d6fb11901d62c4b5968c181e;hb=58a2b493f8df1072a1faa653c8abb6a3f9ba21fa;hp=fb4f74d3b50621dec1e32b858a6004efc230547e;hpb=e55924b6886bd7382a28e1ae235c4810f852e163;p=nepi.git diff --git a/examples/linux/ccn_transfer_using_linuxapp.py b/examples/linux/ccn_transfer_using_linuxapp.py index fb4f74d3..8bf7cfc0 100644 --- a/examples/linux/ccn_transfer_using_linuxapp.py +++ b/examples/linux/ccn_transfer_using_linuxapp.py @@ -40,6 +40,8 @@ # $ cd # python examples/linux/ccn_advanced_transfer.py -a -b -u -i +from __future__ import print_function + from nepi.execution.ec import ExperimentController from nepi.execution.resource import ResourceAction, ResourceState @@ -116,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 & " @@ -205,12 +207,11 @@ 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() -print "Transfered FILE stored localy at video.ts" +print("Transfered FILE stored localy at video.ts")