RE: Control Printer Queue On Windows 2000/XP

Discussion in 'Python' started by Tim Golden, Jun 30, 2005.

  1. Tim Golden

    Tim Golden Guest

    [binarystar]
    | Hi folks,
    |
    | I am writing a script to print a few thousand pdf documents and I need
    | to have some control over the number of jobs that are sent to the
    | printer queue at time ... something along the lines of
    |
    | if number_jobs > MAX_JOBS:
    | time.sleep(10)
    | else:
    | #Print More Files
    |
    |
    | I have been investigating the win32print utility
    | http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32
    | /win32print.html
    |
    | ... but can not see how to get print queue information eg the
    | number of
    | jobs pending .. atleast my attempts are failing

    Assuming I understand the need, you can do something like
    this with WMI:

    <code>
    import wmi

    c = wmi.WMI ()
    print len (c.Win32_PrintJob ())

    </code>

    TJG

    ________________________________________________________________________
    This e-mail has been scanned for all viruses by Star. The
    service is powered by MessageLabs. For more information on a proactive
    anti-virus service working around the clock, around the globe, visit:
    http://www.star.net.uk
    ________________________________________________________________________
    Tim Golden, Jun 30, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    870
    dave wanta
    Jul 11, 2003
  2. Samuel Lee
    Replies:
    0
    Views:
    512
    Samuel Lee
    Nov 11, 2003
  3. binarystar
    Replies:
    0
    Views:
    415
    binarystar
    Jun 30, 2005
  4. Russell Warren

    Is Queue.Queue.queue.clear() thread-safe?

    Russell Warren, Jun 22, 2006, in forum: Python
    Replies:
    4
    Views:
    678
    Russell Warren
    Jun 27, 2006
  5. Kris
    Replies:
    0
    Views:
    477
Loading...

Share This Page