How do I change a process name or even a thread name in python!

Donn Cave donn at u.washington.edu
Mon Feb 12 19:37:39 EST 2001


Quoth Kenneth Loafman <ken at lt.com>:
| C manages because the executable is the same as the program.  A script
| is different.  The interpreter name (python, sh, bash, etc.) will appear
| as the name if you run it like '$ python foo.py'.  Same applies to '$ sh
| script'.
|
| Try putting a '#! /usr/bin/python' as the first line, then running it as
| '$ ./foo.py'.  Under Linux/UNIX, that picks up the right name and
| arguments for ps aux.

It does?  I don't think so!

$ ./iam &
[1] 28372
$ ps wwaux | fgrep iam
donn     28372  0.8  0.4  2768 1140 pts/1    S    16:31   0:00 /usr/local/bin/python ./iam

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list