Re: Get thread pid

2009-02-02 Thread Ove Svensson
Alejandro writes: > On Jan 30, 1:40 pm, Christian Heimes wrote: >> May I ask why you want to get the TID? > > htop shows the TID of each thread. Knowing the TID allows me to know > which thread is hogging the CPU. If there is a better way to do this, > or there is something fundamentally wrong w

Re: Get thread pid

2009-01-30 Thread Ove Svensson
Alejandro writes: > Hi: > > I have Python program running under Linux, that create several > threads, and I want to now the corresponding PID of the threads. > > In each of the threads I have > > def run(self): > pid = os.getpid() > logger.critical('process ID: %s', pid) > > However, the

Re: spawning a process with subprocess

2007-11-27 Thread Ove Svensson
bhunter <[EMAIL PROTECTED]> writes: > Hi, > > I've used subprocess with 2.4 several times to execute a process, wait > for it to finish, and then look at its output. Now I want to spawn > the process separately, later check to see if it's finished, and if it > is look at its output. I may want

Re: setuid root

2006-08-24 Thread Ove Svensson
"Tiago Simões Batista" <[EMAIL PROTECTED]> writes: > > Any sugestions? > http://www.faqs.org/faqs/unix-faq/faq/part4/section-7.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Queue can result in nested monitor deadlock

2006-04-19 Thread Ove Svensson
"Jonathan Amsterdam" <[EMAIL PROTECTED]> writes: > No redesign necessary. I simply make M be the Queue's mutex, via the > LQueue class I posted. I am making the modest suggestion that this > feature be documented and exposed in the Queue class. > Even though LQueue is the correct sollution to th

Re: Easiest way to calculate number of character in string

2005-12-21 Thread Ove Svensson
Ove Svensson <[EMAIL PROTECTED]> writes: > "P. Schmidt-Volkmar" <[EMAIL PROTECTED]> writes: > > > Hi there, > > > > I have a string in which I want to calculate how often the character ';' > > occurs. If the character does not o

Re: Easiest way to calculate number of character in string

2005-12-21 Thread Ove Svensson
"P. Schmidt-Volkmar" <[EMAIL PROTECTED]> writes: > Hi there, > > I have a string in which I want to calculate how often the character ';' > occurs. If the character does not occur 42 times, the ";" should be added so > the 42 are reached. > > My solution is slow and wrong: > for Position

Re: canceling and joining threads

2005-12-19 Thread Ove Svensson
"sir_alex" <[EMAIL PROTECTED]> writes: > Hello everybody! I have a couple of questions about threads: the first > is, is there the possibility to cancel a thread while it is executing > (like the C function thread_cancel), for implementing something like an > "abort" button? As far as I know, py