Re: Print file via file association using os.system or subprocess?(Windows)

Discussion in 'Python' started by python@bdurham.com, Jul 19, 2010.

  1. Guest

    Hi Mark,

    > You probably want to use the windows ShellExec function with a 'print' verb.


    Thanks Mark! And cheers for the great win32api library!!

    I've included a link[1] on how to do this for anyone searching the
    archives.

    Malcolm

    [1] Print via ShellExecute (prints to the user's default printer)
    http://timgolden.me.uk/python/win32_how_do_i/print.html#shellexecute

    Example:

    win32api.ShellExecute( 0, 'print', fileName, None, '.', 0 )

    <snipped>
    Under Windows: Is there a way to print a file using the file's file
    extension association using either the os.system or subprocess modules
    (vs. win32 extensions)?

    Use case: print PDF or Office documents to default printer without
    having to distribute win32 extensions.
    </snipped>
     
    , Jul 19, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arne Vajhøj
    Replies:
    5
    Views:
    1,840
  2. Stefan Ram
    Replies:
    0
    Views:
    317
    Stefan Ram
    Jul 1, 2012
  3. markspace
    Replies:
    0
    Views:
    279
    markspace
    Jul 1, 2012
  4. Roedy Green
    Replies:
    0
    Views:
    293
    Roedy Green
    Jul 1, 2012
  5. Replies:
    2
    Views:
    324
    Roedy Green
    Jul 1, 2012
Loading...

Share This Page