开发者

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 m开发者_运维技巧e

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

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

process.kill() #kill


Python subprocess module and some good examples and explanation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜