Schoeni, Yann wrote:
>  
>
> I’m trying to get error informations from my printer.
>
>  
>
> The job is sending from a web application, the application use the php
> function « Shell_exec » to call the python CLI and passe the arguments
> to the python script.
>
>  
>
> Anyway, I first tried to raise an exception if the printer isn’t turn
> on, but it’s harder than I thought, is there an easy way to do it ?
>
>  
>
> I tried to do it by using the command « GetPrinter » but nothing seems
> to point the power state of the printer.
>

The "Status" value tells you some of that information.  The bits are
defined here:
    https://msdn.microsoft.com/en-us/library/cc244854.aspx

Power state is a tricky thing for the system to handle.  The spooler
wants to allow you to submit print jobs even if the printer is off or
offline, because it will probably come back at some point.  I suspect
you will find PRINTER_STATUS_SERVER_OFFLINE in that case.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to