Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Is it technically possible to give Python option of naming process of running script? Date: Wed, 14 Mar 2012 16:02:02 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 28 Message-ID: References: <19118128.4791.1331736187952.JavaMail.geo-discussion-forums@vbai14> NNTP-Posting-Host: dsl.comtrol.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: reader1.panix.com 1331740922 10189 64.122.56.22 (14 Mar 2012 16:02:02 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 14 Mar 2012 16:02:02 +0000 (UTC) User-Agent: slrn/pre0.9.9-102 (Linux) Xref: csiph.com comp.lang.python:21609 On 2012-03-14, Chris Angelico wrote: > On Thu, Mar 15, 2012 at 1:43 AM, xliiv wrote: >> Like the topic.. . >> I use Python a lot, both Windows and Linux, and it's little weird to have many python process without fast distinction which is what. > > I've no idea if it's even possible on Windows. On Linux, what you want > is the prctl function, which (AFAIK) isn't directly available. > > Google is your friend, though. Question's already been asked on Stack > Overflow and such, and has a few answers. Nothing that looks > cut-and-dried ready, but several that might work. The question of how to set the application name comes up somewhat regularly. It would be awfully nice if there was a way for python applications to set their application name. It's especially useful for daemons, and makes it much easier when you can kill them by name instead of having to look up the PID. It seems like an excellent thing to add to the "os" module. > Look for 'prctl' and 'PR_SET_NAME', which are the C-level function > and constant that do the job; a cursory examination of PyPI shows a > module with prctl in the name, so that may be of value. -- Grant Edwards grant.b.edwards Yow! TONY RANDALL! Is YOUR at life a PATIO of FUN?? gmail.com