Process Management

These functions can create and manage additional processes:

execl(path, arg0, arg1, ... )

This is quivalent to execv( path, (arg0, arg1, ...) ). Availability: Unix, Windows.

execle(path, arg0, arg1, ..., env )

This is equivalent to execve( path, (arg0, arg1, ...), env ). Availability: Unix, Windows.

execlp(path, arg0, arg1, ... )

This is equivalent to execvp( path, (arg0, arg1, ...) ). Availability: Unix, Windows.

execv(path, args )

Executes the executable path with argument list args, replacing the current process (i.e., the Python interpreter). The argument list may be a tuple or list of strings. Availability: Unix, Windows.

execve(path, args, env )

Executes the executable path with argument list args, and environment env, replacing the current process (i.e., the Python interpreter). The argument list may be a tuple or list of strings. The environment must be a dictionary mapping strings to strings. Availability: Unix, Windows.

execvp(path, args )

Like execv( path, args ) but duplicates the shell’s actions in searching for an executable file in a list of directories. The directory list is obtained from environ['PATH']. Availability: Unix, Windows.

execvpe(path, args, env )

A cross between execve() and execvp(). The directory list is obtained from env['PATH']. Availability: Unix, Windows.

_exit(n )

Exits to the system with status n, without calling cleanup handlers, flushing stdio buffers, etc. Availability: Unix, Windows.

The standard way to exit is sys.exit( ...

Get Python Programming On Win32 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.