Possible bug plus a question
Chris McCormick
chris at mccormick.cx
Thu May 5 03:34:59 BST 2005
On Wed, May 04, 2005 at 10:49:07AM +0200, David Allouche wrote:
> 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.
Just for the record, there's another non-portable, non-pretty solution:
<http://mail.python.org/pipermail/python-list/2002-July/114365.html>
Best regards,
Chris.
-------------------
chris at mccormick.cx
http://mccormick.cx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050505/8585e248/attachment.pgp
More information about the bazaar
mailing list