exec * () familiy replaces the whole process, storing the process number (PID). If this is what you want ...
One example inside the Python interpreter. I am replacing the interpreter with an echo. The first element in 'args' becomes argv [0], which is the name of the process that maps to ps or top.
>>> import os
>>> args=['process_name', 'bla', 'ble']
>>> os.execlp("/bin/echo", *args)
bla ble
/Users/epx $
source
share