Search code examples
pythonwindowslauncher

How to create a exe launcher using python in windows


i need to launch a exe using a python script but also I need to kill it using the same script

A start idea is:

process = magicCommand( 'theExe.exe' ) #invoke exe

kill = 'no'
while kill == 'no':
    kill = raw_input()

otherMagicCommand( process ) #kill

EDIT

this works in windows for me

process = subprocess.Popen( 'theExe.exe' ) #invoke exe

kill = 'no'
while kill == 'no':
    kill = raw_input()

process.kill() #kill

Solution

  • Python subprocess module and some good examples and explanation