Hard to be wise without knowing the context, but I avoid config files as much as possible, because:
- Where does the config file live on different machines?
- What if I want to have 2 configurations on one machine?
- What if I need to change the list dynamically?
`for ip in sys.args` would give you most flexibility.
... writing 34 IP addresses as CLI parameter, that is around 373 letters, is not a nice solution.
./script 127.0.0.1 5 ./script 127.0.0.2 5 . . . ./script 127.0.1.254 10
I had to call program will all IP addresses, one by one would just not work.
Your idea is fine, but it was just acceptable in my use case.
./script \ 192.168.1.1 \ 192.168.1.2 \ 192.168.1.3 \ ...
Hard to be wise without knowing the context, but I avoid config files as much as possible, because:
- Where does the config file live on different machines?
- What if I want to have 2 configurations on one machine?
- What if I need to change the list dynamically?
`for ip in sys.args` would give you most flexibility.