sys.argv[0] and ps aux

Nils O. Selåsdal NOS at Utel.no
Sun May 16 19:23:39 EDT 2004


And Heiko Wundram said...

> Hi all!
> 
> Is there some way to set sys.argv[0] on a Unix platform and have the
> string which is set show up in the output of ps aux? IIRC when I (re)set
> argv[0] in C, the newly set string pops up in ps aux (but I may be wrong
> here, it's a long time since I last programmed in C... ;)).
Not any general way in python. Some have a C setproctitle function. On
others you have to do arcane mangeling with the (C) argv array. 
In short, no.




More information about the Python-list mailing list