[Python-checkins] r43586 - python/trunk/Modules/posixmodule.c

"Martin v. Löwis" martin at v.loewis.de
Tue Apr 4 08:19:25 CEST 2006


Neal Norwitz wrote:
> I'm not sure of the exact syntax on windows, but how about something like:
> 
>   command.exe echo "string"

This is something different:

os.startfile("foo.doc")

will open Microsoft Word, and

os.startfile("foo.doc", "print")

will open Word to print the document. Likewise, os.startfile("foo.html")
will open the registered Web browser.

> Where string can be unicode?

In this patch, only the first argument (the document file name) can
be Unicode. In principle, the second argument could also be a Unicode
string, but an ASCII byte string is sufficient, since these "verbs"
are a fixed set in practice ("open", "print", "edit", "play", ...)

> I'm not sure of all the variations.  How
> about if command.exe is unicode?  Something like that seems relatively
> easy and should catch most shallow errors.  Is that or something
> similar doable?

The problem is that it always starts an external application, depending
on the extension. It is difficult to make that application go away.
Plus, we would need an extension that is known to work on all Windows
systems.

Regards,
Martin


More information about the Python-checkins mailing list