ANNOUNCE - Proctitle 0.0.2

Dave Cinege dcinege-dated-1091754096.7173b7 at psychosis.com
Sat Jul 31 21:01:30 EDT 2004


Proctitle 0.0.2 has been released. It fixes a None deallocation bug that 
appeared in in newer Python's, (Uhm...Newer then 2 years ago.  : P) and 
includes a new slideback() method and shorthand function, for easier removal 
of Argv[0].

IE:
	import proctitle
	proctitle.slideback()   # 'python' is no more in the `ps` output!


Most of the time:
https://ftp.psychosis.com/python/
Some of the time (like weekends):
ftp://ftp.psychosis.com/python/

Have fun,
Dave


On Mon, 22 Jul 2002 20:00:55 -0400, Dave Cinege wrote:

keyphrases:
setproctitle proctitle
change process name
change process title
change ps output
argv[0] argv[-1]

It was about a year ago, I produced a nasty patch to sys that allowed
changing the raw argv[] of the python process.

A year later its sad this functionality has *still* not be intergrated
into Python itself. : <

In linux this modules allows one to change the output seen from 'ps'.
(And the processes 'cmdline' in /proc/)
It is useful for hiding 'python', an argument that is a password,
or update process information.

The joy of unempoyment has given me the time to rewrite my patch as
a stand alone module. The module is by no means done. I need people
to test on platforms other then Linux and provides results.

Once it has been made portable, I intend to talk to Guido about how
he'd like to see this intergrated into Python, and then do so.
It would likely become an extension to the posix module.

Please DL from:
http://ftp.psychosis.com/python/
ftp://ftp.psychosis.com/python/


An idea how it currently works:

import proctitle
Argv = proctitle.ProcTitle()

print 'Saving Original argv[]'
Argv.save()
print 'argv[0:2]: ', Argv[0:2]
print Argv

Argv[0] = 'Python - Why use anything else?'
Argv[0:] = 'Python - Why use anything else?'

print 'Slide argv args back one. (hide "python")'
print 'Process line now matches sys.argv'
Argv[0:] = string.join(Argv[1:]).replace(',','')

print 'Restoring Original argv[]'
Argv.restore()




More information about the Python-list mailing list