0

Pythonスクリプトを使用してexeを起動する必要がありますが、同じスクリプトを使用してそれを強制終了する必要もあります

開始のアイデアは次のとおりです。

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

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

otherMagicCommand( process ) #kill

編集

これは私にとってWindowsで動作します

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

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

process.kill() #kill
4

1 に答える 1

2

Python サブプロセス モジュールといくつかの良いと説明

于 2011-08-15T17:19:05.717 に答える