I have a python program where I try to send a document to a printer. It works fine in my machine with a local printer set as the default printer and connected with my laptop via USB. However, when I tried it with another computer with its default printer being in a network it doesn't work. The error I get is:
pywintypes.error: (31, 'ShellExecute', 'A device attached to the system is not functioning.')
The piece of code is giving problems is the following one:
win32api.ShellExecute(0,"print",doc_path,None,".",0)
I think the problem is because of the printer being connected using the network and not the USB, but it might be another thing.
Thanks for any help.