ns-3-python-examples icon indicating copy to clipboard operation
ns-3-python-examples copied to clipboard

Passed argument argv unused

Open kaushiksk opened this issue 7 years ago • 0 comments

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:

  1. Remove the argv option from main. import sys globally on top. Call cmd.Parse with sys.argv.
  2. Call cmd.Parse with argv.

I feel Option 2 would make the program much more readable.

kaushiksk avatar Nov 20 '18 09:11 kaushiksk