before going further ,one question... is it possible to do it ?
If the answer is yes... then which library, and which is the best practice to implement it on a python script.
If the answer is no, by which language is it possible, that i start learning it enough to proceed my project.
Project Description : I want to write program(using classes) to stop the desired windows programs from running.
The only thing I need is to know is which library, which module and which class or function in order to open or stop apps from running using python(mainly closing the windows programs).
Note:The reason why i did not mention the code was for its long length, and the fact that it did not help, because the only thing which matters is which library and module to use.
os.systemor thesubprocessmodule) the builtin Windowstaskkillcommand — and don't thinkos.killwould work on that OS. Also note that killing a process isn't quite the same as making it exit.os.killworks. It opens a handle to the process and callsTerminateProcesswith the given exit status, so it's like a UnixSIGKILL. But for an exit status of 0 or 1 it's conflated with callingGenerateConsoleCtrlEventto sendCTRL_C_EVENT(0) orCTRL_BREAK_EVENT(1) to a process group that's attached to the current console. Avoid that by using an exit status that's greater than 1. That said, a forceful termination should be a last resort. The process should be given a chance to exit cleanly, and Python'sos.killdoesn't support this, unlike "taskkill.exe".