ns-3-python-examples
ns-3-python-examples copied to clipboard
Passed argument argv unused
https://github.com/mohittahiliani/ns-3-python-examples/blob/8ee504fad8d80dea2a695fd8d7e85b7d8fe3733e/tcp/tcp-bulk-send.py#L47
In the example, the main function takes an argument argv, to which sys.argv is passed during runtime. However the argv variable is never used in the program and the cmd.Parse is again supplied with sys.argv itself.
I feel this would be confusing to a user reading the code.
Suggestions:
- Remove the
argvoption from main.import sysglobally on top. Callcmd.Parsewithsys.argv. - Call
cmd.Parsewithargv.
I feel Option 2 would make the program much more readable.