X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b35790c56064ca6b1b537bc81fd15616f64d1f21..84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6:/examples/python/exec-basic/exec-basic.py diff --git a/examples/python/exec-basic/exec-basic.py b/examples/python/exec-basic/exec-basic.py index 60e0bf69ad..579c3f41fa 100644 --- a/examples/python/exec-basic/exec-basic.py +++ b/examples/python/exec-basic/exec-basic.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2019. The SimGrid Team. All rights reserved. +# Copyright (c) 2018-2020. The SimGrid Team. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the license (GNU LGPL) which comes with this package. @@ -30,13 +30,11 @@ def privileged(): # quite quickly. -i = 0 -if "--" in sys.argv: - i = sys.argv.index("--") -e = Engine(sys.argv[0:i]) -e.load_platform(sys.argv[i + 1]) +if __name__ == '__main__': + e = Engine(sys.argv) + e.load_platform(sys.argv[1]) -Actor.create("executor", Host.by_name("Tremblay"), executor) -Actor.create("privileged", Host.by_name("Tremblay"), privileged) + Actor.create("executor", Host.by_name("Tremblay"), executor) + Actor.create("privileged", Host.by_name("Tremblay"), privileged) -e.run() + e.run()