473,289 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

renice


Hi

Is it possible to renice the python process executing the current python
script ?:confused:
--
View this message in context: http://www.nabble.com/renice-tf4695834.html#a13422771
Sent from the Python - python-list mailing list archive at Nabble.com.

Oct 26 '07 #1
2 2264
Dan
On Oct 26, 4:30 am, mokhtar <mbmessa...@yahoo.comwrote:
Hi

Is it possible to renice the python process executing the current python
script ?:confused:
--
View this message in context:http://www.nabble.com/renice-tf4695834.html#a13422771
Sent from the Python - python-list mailing list archive at Nabble.com.
On UNIX:
>>import os
os.system("renice -n %d %d" % ( new_nice, os.getpid() ) )
(untested)

I don't know if windows has the concept of renice...

-Dan

Oct 26 '07 #2
On Oct 26, 12:46 pm, Dan <thermos...@gmail.comwrote:
On Oct 26, 4:30 am, mokhtar <mbmessa...@yahoo.comwrote:
Hi
Is it possible to renice the python process executing the current python
script ?:confused:
--
View this message in context:http://www.nabble.com/renice-tf4695834.html#a13422771
Sent from the Python - python-list mailing list archive at Nabble.com.

On UNIX:>>import os
>os.system("renice -n %d %d" % ( new_nice, os.getpid() ) )

Hmm. That seems to be the hard way, since you can set the nice value
of the current process (almost) directly:

import os
nice_adder = new_nice - os.nice(0)
os.nice(nice_adder)
But I suppose it could be useful in situations where you need
privleges you don't currently have. E.g.:

os.system("sudo renice -n %s %s" % (new_nice, os.getpid()))
Carl Banks
Oct 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eugene Morozov | last post by:
Hello! I wrote a crossplatform Glade/GTK+ application for learning foreign languages (it is called Snakememory but doesn't have site in English yet). Currently it works from the directory where...
2
by: Alan Hewat | last post by:
I have a relatively modest mySQL database with a PHP interface (70,000 entries). On a standard Dell Dimension 4400 (1.9 GHz with 512 Mbytes) running Suse 8.1 a typical query takes 0.66 sec with no...
10
by: Jason Gyetko | last post by:
I'm running DB2 v8.1 FP5 on a Server with 2 physical processors (4 virtual) and am wondering if there is a way to configure DB2 to use more processor. Right now I'm running a delete query to delete...
9
by: Eugeny Balakhonov | last post by:
Hi! How to change query priority dynamically? I have a web site which uses PostgreSQL as a host database and a background program which uses this database too.
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.