Nov-29-2019, 04:42 AM
Nov-29-2019, 04:59 AM
when you execute a script from the command like, argv will contain all of the arguments.
example:
$ python myscript.py -a -dc -q
then argv will contain:
argv[0]: myscript.py
argv[1]: -a
argv[2]: -dc
argv[3]: -q
example:
$ python myscript.py -a -dc -q
then argv will contain:
argv[0]: myscript.py
argv[1]: -a
argv[2]: -dc
argv[3]: -q
Nov-29-2019, 05:02 AM
ok. my issue is i don't want to pass argument every time so i define all the arguments in my file called configuration-file.ini and i want it to read from this file, so you tell me how can i do so?
example:
$ python myscript.py configuration-file.ini
here is the whole code: https://github.com/JamesBarwell/haproxy-...-status.py
output: https://github.com/JamesBarwell/haproxy-status.py
i don't wan to pass multiple argument every time when i run the program. so i put all the sock path in a different file and i want to call it from there
example:
$ python myscript.py configuration-file.ini
here is the whole code: https://github.com/JamesBarwell/haproxy-...-status.py
output: https://github.com/JamesBarwell/haproxy-status.py
i don't wan to pass multiple argument every time when i run the program. so i put all the sock path in a different file and i want to call it from there
Nov-29-2019, 05:41 AM
Your other thread is all about that - how to use config file, but you don't follow directions. I will lock this thread now. Keep discussion in https://python-forum.io/Thread-hatop-issue