Possible bug plus a question
David Allouche
david at allouche.net
Wed May 4 09:49:07 BST 2005
On Mon, 2005-05-02 at 14:06 +0800, Chris McCormick wrote:
> 1. My program is run using the Python interpereter. I have a symlink
> in the working directory of the sources of my project, to the Python
> executable like this: zutexe -> /usr/bin/python
>
> This is so that my program name will show up in ps as 'zutexe' instead of
> showing up as Python (maybe there's a better way of changing the process
> name?). I get the following when I do a bzr status on the directory.
I believe you can achieve that effect in C by assigning to argv[0], but
assigning sys.argv[0] in Python does not do it.
Another way (untested) to do it would be to use
os.execv(sys.executable, [newname, pathtoscript] + args)
Not portable, not pretty. Well, the symlink trick isn't either.
--
-- ddaa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050504/c164878f/attachment.pgp
More information about the bazaar
mailing list