I need your help please and Thanks ♥
p = subprocess.Popen(str(filepath), shell=True, stdout = subprocess.PIPE)
How could I stop a running file or kill it (.bat file) ? I used a code in function to open it : p = subprocess.Popen(str(filepath), shell=True, stdout = subprocess.PIPE) so I want to make another ...
p = subprocess.Popen('exit ' + str(filepath), shell=True, stdout = subprocess.PIPE)
In terminal to close a opened programe you can use:
taskkill我试过这样的事情:IM AppName >nul例如 taskkill IM notepad++.exe >nul。现在你可以使用os库来输入。
os.system(f'cmd /c "taskkill /IM notepad++.exe >nul"')