Open PDF

Thomas Heller theller at python.net
Fri Sep 23 15:54:54 EDT 2005


"Martin Miller" <ggrp1.20.martineau at dfgh.net> writes:

> IMHO, the fact that there is no way to wait for the application to
> finish is major deficiency with os.startfile() -- and why I often
> cannot use it instead of other techniques [such as the much more
> involved but limited os.spawnv() function].
>
> I don't if if this is just a limitation of the implementation in the
> Python os module or one with the underlying OS (Windoze) -- I suspect
> the latter.

os.startfile calls ShellExecute.  AFAIK, if ShellExecuteEx were used,
this could retrieve a process handle which you could wait for os so.

With ctypes you can easily experiment with this kind of stuff.  Another
interesting feature, imo, is the 'verb' that you can pass to these
functions. With this, you could for example specify 'print' to print the
file instead of just opening it.

Thomas



More information about the Python-list mailing list