os.system vs. Py2Exe

Jeff Shannon jeff at ccvcorp.com
Wed Sep 29 00:25:32 CEST 2004

Peter Hansen wrote:

> Jeff Shannon wrote:
>> Remember, os.system() is roughly equivalent to typing the argument at 
>> a command line.  Does typing "myfile.txt" at a commandline prompt 
>> open that file in a text editor?  (Hint -- it shouldn't, under normal 
>> circumstances.)
> Unfortunately for your theory, on XP typing just the name of the
> file (at least with a .txt file) does indeed open it in the associated
> application.

Why, so it does... and under Win2K, as well. 

> I suspect the "other" machine he is using is not an XP machine, and
> thus not suffering from such unexpected behaviour.  Thanks, Mickysoft...

Yes, if the "other" machine is Win9x/ME (or, I believe, NT4), using the 
.txt filename as a command will result in an error.  As it should, also, 
under *nix (and probably MacOS) as well, unless I'm even more confused 
than I'd thought. ;)

This does, at least, do away with the need to presume some sort of 
screwy settings on the O.P.'s machine -- said screwy settings being 
provided by default from Microsoft.  ;)

Jeff Shannon
Credit International

More information about the Python-list mailing list