What shell command can I use on Windows (XP or later) to trigger a print dialog?

In Python, if I want to open / launch the default browser using the shell, I can import os and run run "www.google.com". Is there a similar way to open the image print dialog for a given .jpg image, as if he had right-clicked and selected print in the context menu that I can use to call this routine from python ???

Thank.

0
source share
2 answers

You can call win32api.ShellExecuteusing the verb "print". Example: http://timgolden.me.uk/python/win32_how_do_i/print.html

+3
source

, Windows (Windows 7), , . , ShellExecute, , . :

import time, win32api
win32api.ShellExecute(0, "print", "test.jpg", None, None, 0)
time.sleep(5)

sleep() , python , .

, . , .

, , pythonw, . , Python, , .

+2

All Articles