[python-win32] A little help for a n00b, please
vernondcole at gmail.com
Sun May 6 05:44:22 CEST 2012
First, make sure that you can type "print somefile.txt" on a console
command line and get it to work. Often the old DOS style print command -
which is what you are trying here - will not work on new Windows printers.
You may very likely have to use a much more complex method involving the
Windows print spooler.
On May 5, 2012 7:25 PM, "Alan Jump" <alan.jump at gmail.com> wrote:
> Trying to massage an older package (not written by me) into functioning
> order. The issue I'm having is getting printing functionality to work.
> The code snippet in question:
> if platform.system() == 'Windows':
> import win32api
> print('* FAILED TO LOAD WINDOWS EXTENSION')
> win32api.ShellExecute (0, "print", filename, None, ".", 0)
> print('* FAILED TO SEND PRINT TO WINDOWS PRINTER')
> The output file is generated in a separate code section and the filename
> being passed has been verified, but I invariably get the message in the
> second exception. That tells me the win32api is being properly imported,
> but for some reason, it's throwing an exception when trying to write to
> the print device. I commented out the "try - except" statements, and got
> an error message that the device could not be opened. I'm wondering if
> there's a UAC or permissions issue I'm running up against.
> Specifics: Windows Vista Home Basic, fully patched. Python 3.2,
> PyWindows build 217.
> 73 de N5ILN/6
> python-win32 mailing list
> python-win32 at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the python-win32