Python Forum

Full Version: changing the process command line arguments in python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
in C i can update the argv[] strings in place with a new set of arguments and it shows up when the ps command (in Linux or Unix) shows the process command line. when i am forking child processes without doing any of the exec syscalls to reload the process, this is often a convenient way to know which process is doing what (otherwise they all appear the same way as the parent). is there a way to do this in Python? can it be made portable to work on Windows (if it has a tool to show processes).

searching on google just gets pages telling how to parse command line arguments.

i am currently updating an old program that gets some data from each AWS region. it runs a child process for each region so they are all accessed in parallel. i am taking the opportunity to improve many aspects of this old program.
i don't see anything in psutil that can change the argument info of itself (same process).
It's more about looking at processes. I don't know how to change their arguments.
Look at pyrasite. It may help.