os.startfile: Why is there no arguments option?

Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915 at spamschutz.glglgl.de
Wed Oct 12 05:27:48 EDT 2011


Am 12.10.2011 10:22 schrieb Christian Wutte:

> Hello all,
> as stated in the docs [1] os.startfile relies on Win32 ShellExecute().
> So maybe someone can explain it to me, why there is no support for
> program arguments.

Because it is intended to start an arbitrary file of any type (.txt, 
.doc, ...) For this operations, there is no parameter support.


> That's quite a pity since os.startfile is the easiest way for an
> elevated run (with 'runas' as option)

Obviously not.

 > and without arguments of limited use.

So it isn't the asiest way.

Have you tried os.system() and/or subprocess.Popen() resp. .call()?


Thomas



More information about the Python-list mailing list