I am reading "Programming Python" 4e and on Page182 there is this line of code:
os.execlp('python', 'python', 'child.py', str(parm))
The purpose of the code is to run the script 'child.py'. However, I do not understand why there are two 'python's in the argument list. I believe that execlp take arguments like execlp(program, cmdarg1, cmadarg2,... cmdargN). So here the first 'python' is the program, that's ok; but what is the second 'python' for? If that's an argument, then we are basically running "python python child.py" and that does not make sense.
Actually I tried to use:
os.execlp('python', 'child.py', str(parm))
instead, but the result was that a new instance of python environment is launched without running the 'child.py' script.
So, how should I interpret the two 'python's in the argument list?
exec()is something else entirely, as I'm sure at least one poster came in prepared to tell you (and how you should never use it)