Question: How to execute an EXE with Python?

Fausto Arinos de A. Barbuto fbarbuto at telusplanet.net
Thu Aug 29 03:38:31 CEST 2002


     
Hi,

    I would be very glad to help, but I have neither XP nor
    ActivePython. Sorry.

---Fausto


"xWestler" <NoThanks@^*^#*&%.com> wrote in message:
 news:MPG.17d6d9502d6b3d2989684 at news.newsguy.com...
> I'm new to Python and I wanted to try this so I created a SpawnDos.py 
> script on my desktop containing only this:
> 
> import os
> os.execl(r"c:\windows\system32\cmd.exe", "/k", r"dir")
> 
> Double clicking on the script acts as described but running it under 
> PythonWin causes PythonWin to crash.  Bad pointer.  There was an access 
> to address 0x00000004.
> 
> This is on XP Pro with the ActiveState distribution.
> 
> Who, if anyone, would care about this?
> 
> In article <3D6BB110.34C7D54D at erols.com>, whrauser at erols.com says...
> > Fausto,
> > 
> > This will keep the dos window open so you can see what is happening.
> > (Windows 2000)
> > 
> > """ Execute program in cmd window, /k keeps dos window open """
> > import os
> > myPy = 'c:/python22/lib/lib-tk/turtle.py'
> > os.execl('c:/winnt/system32/cmd.exe', '/k', myPy)
> > 
> > # Could specify path to python if necessary
> > #os.execl('c:/winnt/system32/cmd.exe', '/k', 'c:/python22/python.exe',
> > myPy)
> > 
> > But, I generally use the spawn series, since I want to return to my
> > script after the program runs.
> > 
> > Walt
> > 
> >




More information about the Python-list mailing list