[Python] after window close program.exe file still running in background

Discussão em 'Python' iniciado por Stack, Fevereiro 5, 2025.

  1. Stack

    Stack Membro Participativo

    I have a script that runs a program.exe in the background. How to close a program from the background in task manager after closing the command window script

    script

    command = [
    "program.exe",
    "-i",
    "-o",
    ]


    process = subprocess.Popen(
    command,
    stdout=subprocess.PIPE,
    stderr=subprocess.PIPE,
    text=True,
    bufsize=1,
    universal_newlines=True,
    )
    stdout, stderr = process.communicate()

    print(command)

    Continue reading...

Compartilhe esta Página