command line arguments processing: an ugly lpr wrapper

Ben Hutchings do-not-spam-ben.hutchings at
Tue Mar 18 11:13:22 CET 2003

In article <b535r7$s2f$1 at>, morden wrote:
> os.execv("/usr/bin/lpr", new_arg)
> # should I exit(os.execv("/usr/bin/lpr", new_arg)) instead?

No.  The exec family of functions *replaces* your program with the
one you specify.  They never return successfully, and in Python,
they raise an exception when they fail.

More information about the Python-list mailing list