[Python] WINDOWS: Open external programs with python, keep them opened after terminating the...

Discussão em 'Python' iniciado por Stack, Setembro 23, 2024.

  1. Stack

    Stack Membro Participativo

    I've written a python script that (via a UI) lets me open files in different programs (for instance Microsoft Word).

    The problem is that, when I terminate the Python script, the programs also close.

    How do I prevent this?

    This is how the script opens files at the moment:

    DETACHED_PROCESS = 0x00000008
    subprocess.Popen(['start', '', file_path], shell=True, creationflags=DETACHED_PROCESS)


    Adding this: CREATE_NEW_PROCESS_GROUP, also doesn't work.

    OSError: [WinError 193] %1 is geen geldige Win32-toepassing

    Continue reading...

Compartilhe esta Página