[Python] Why am I getting an "execv(file, args)" error when using execl()?

Discussão em 'Python' iniciado por Stack, Março 23, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to use execl() to execute a new program but it keeps returning an execv() error saying that arg2 must not be empty.

    if pid == 0:
    print("This is a child process")
    print("Using exec to another program")
    os.execl("example_prg_02.py")


    Why would this be the case when using execl()? Does execl() require args too?

    Continue reading...

Compartilhe esta Página