Arguments to exec* functions.

Fredrik Lundh fredrik at
Mon Nov 13 20:02:48 CET 2000

Neil Cerutti wrote:
> If I'm required to put *something* there, what's a good string to
> use? Prepending all my argument lists with "foo" seems kind of
> stupid. Prepending all my argument lists with the executable name
> seems kind of redundant.

doesn't matter -- the exec functions are defined by the
POSIX standard:

    "The argument path points to a pathname that identifies
    the new process image file"

    "The argument argv is an array of /.../ strings. /.../ These
    strings constitute the argument list available to the new
    process image. The value in argv[0] should point to a file-
    name that is associated with the process being started by
    one of the exec functions."

here's a standard usage pattern for exec/spawn:

    program = "python"
    arguments = [""]
    os.execvp(program, (program,) +  tuple(arguments))


More information about the Python-list mailing list