Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: Control Printer Queue On Windows 2000/XP

Reply
Thread Tools

RE: Control Printer Queue On Windows 2000/XP

 
 
Tim Golden
Guest
Posts: n/a
 
      06-30-2005
[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/doc...on/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
__________________________________________________ ______________________
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program blocked in Queue.Queue.get and Queue.Queue.put Kris Python 0 01-04-2012 03:46 PM
Is Queue.Queue.queue.clear() thread-safe? Russell Warren Python 4 06-27-2006 03:03 PM
what's the difference between #include "queue.h" and #include "queue.cpp" Kceiw C++ 3 03-14-2006 03:01 AM
Control Printer Queue On Windows 2000/XP binarystar Python 0 06-30-2005 10:02 AM
Queue.Queue-like class without the busy-wait Paul L. Du Bois Python 29 04-04-2005 01:28 PM



Advertisments