Queue/Priority Needed

Keith Nation cricket.keith at gmail.com
Wed Jul 2 17:26:41 EDT 2008


I'm still very new to python, and I have a question about how to prioritize
jobs in a queue.  Currently, I have a simple script that does the following:

job1 = [1, 'Task1', 'v03', '-start', 'Bonnie']
job2 = [2, 'Task2', 'v01', '-start', 'Billy']
job3 = [3, 'Task3', 'v01', '-start', 'Bob']
jobsequence = (job1, job2, job3)

for job in jobsequence:
    jnam=job[1]
    jop=job[3]
    jver=job[2]
    jreq=job[4]
    jpatch=job[5]
    jid=jnam+'/'+jver
    cmdline= /home/user/program/start '+' '+jop+' -proj '+jnam+' -dir
'+'/home/user/programdata/'+jnam+'/'+jver;
    os.popen2(cmdline,mode='t',bufsize=-1)
    x=0
    delay=5

    while os.path.exists(jid+'/log.pid'):
        time.sleep(60*delay)
        x=x+1
print 'Job Complete'

What I would like to do is populate the job listings interactively (using
input lines) and be able to change priority on uncompleted jobs still in the
queue, and add jobs to the queue.  I appreciate any help you folks can
offer.

Keith Nation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080702/8b04247e/attachment.html>


More information about the Python-list mailing list