avoid stderr output

Donn Cave donn at drizzle.com
Tue May 25 19:18:41 EDT 2004


Quoth giorgenes at terra.com.br (Gi?rgenes):
...
| When I use, for example, PyRun_File to run a script and an error
| occur, the error is sent to stderr.
| What can I do to avoid it? To cleanly capture the error w/out it
| beeing sent to stderr.

I think you are talking about the top-level exception handler.
One simple way to do it, if this works for you, is to execute
your own Python program instead, passing the intended script and
arguments as command line parameters to it.  Your Python program 
can run the script in a try: block intercepting any possible error.
I haven't actually done this myself.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list