[pygtk] Subprocess and changing it's priority

Steve McClure smcclure at racemi.com
Mon Feb 25 21:30:41 WST 2008


Take a look the "nice" man page.  That will let you run a process at  
a priority other than the default.

On Feb 25, 2008, at 5:49 AM, Vláďa wrote:

> Hello,
>
> I have a GUI program which runs some CLI processes. I  use modified  
> code of this module:
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554
>
> It is a black magic for me. :-)
>
> Then I run the CLI application:
> self.p = subprocess2.Popen 
> (cmd,shell=False,bufsize=0,stdout=subprocess2.PIPE,stderr=subprocess2. 
> STDOUT)
>
> and add a callback:
> gobject.timeout_add(200,self.progress_callback)
>
> Everything works fine. But I'd like to add an option to change  
> priority of the process I started. It is a video encoder, so it  
> uses 100% of CPU and takes hours to finish. So you might want to  
> lower it's priority. Is there an easy way do do it? Thank you.
>
> Best regards,
> Vlada
>
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>

--
Steve McClure
smcclure at racemi.com



More information about the pygtk mailing list