X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=examples%2Flinux%2Fccn_transfer_using_linuxapp.py;h=1db375d5e06fff5d0879aea431785c60f6ed1014;hb=cb5d027b813a27d7de263653e1a8e0cef5490f0a;hp=81b7195e5a57c30f9a4794ae92fcc43b596e79b7;hpb=741b99fe027fe6b54846a0703d26510d9b40a135;p=nepi.git diff --git a/examples/linux/ccn_transfer_using_linuxapp.py b/examples/linux/ccn_transfer_using_linuxapp.py index 81b7195e..1db375d5 100644 --- a/examples/linux/ccn_transfer_using_linuxapp.py +++ b/examples/linux/ccn_transfer_using_linuxapp.py @@ -5,9 +5,8 @@ # Copyright (C) 2013 INRIA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -41,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 @@ -206,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")