os.system vs. Py2Exe

Lad export at hope.cz
Wed Sep 29 10:52:14 EDT 2004


Peter L Hansen <peter at engcorp.com> wrote in message news:<4_CdnUGCt9u3CcfcRVn-pA at powergate.ca>...
> Lad wrote:
> > Peter Hansen <peter at engcorp.com> wrote in message news:<Rd2dneVBGfQrXMTcRVn-jQ at powergate.ca>...
> > 
> >>Lad wrote:
> >>
> >>>I used Py2exe to compile my script( I use XP).
> >>>The compiled script works OK on my XP where Python is installed.
> >>>But when I install the compiled exe to another computer,
> >>
> >>What operating system is the other computer running?
> > 
> > The other Operating system( that does not work with os.system) is Windows 98
> 
> That's the source of your problem.  Win98 doesn't work the way
> XP/NT does, and you *cannot* use os.system() in this way to
> get the expected behaviour.  Find another approach... maybe
> read the registry entries for .TXT files and launch NotePad
> directly...
I found out the following:
on Xp I can use
os.system('IDPass.txt')

but on Win98
it does not work.
 So I must use
os.system('notepad.exe IDPass.txt') to open IDPass.txt file
but the problem with Win 98 is the following:
Notepad is launched but the Python running  program ( exe compiled
script) is not paused( until I close the Notepad window) but continues
running with the next command.In other words Notepad runs
independently on my exe program.
WHY?

Lad


        if verseOS[3]==2:#XP
            os.system('IDPass.txt')
        if verseOS[3]==1:#Windows 95/98/ME
            print "Windows 95/98/ME running"
            os.system('notepad.exe IDPass.txt')



More information about the Python-list mailing list