Why am I getting an “execv(file, args)” error when using execl()?
问题 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? 回答1: "example_prg_02.py" is not a path to executable file, you have to specify a path to executable file as a 1st parameter, the name of executable as a 2nd one, parameter(s)