[Python.NET] unsubscribe

andy.bu at kodak.com andy.bu at kodak.com
Mon Mar 5 01:17:40 CET 2007

Best Regards,
Kodak Health Group Global R&D Center (Shanghai)
No. 27 Xin Jinqiao Road
Building 4 Jinqiao Software Park,
Shanghai, P.R.China 201206
Tel   :8621-50308810-5374
Mail : Andy.bu at Kodak.com
Building 4, Jinqiao Software Park, Shanghai 201206

pythondotnet-request at python.org 
Sent by: pythondotnet-bounces at python.org
03/04/2007 07:00 PM
Please respond to
pythondotnet at python.org

pythondotnet at python.org

PythonDotNet Digest, Vol 41, Issue 4

Send PythonDotNet mailing list submissions to
                 pythondotnet at python.org

To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to
                 pythondotnet-request at python.org

You can reach the person managing the list at
                 pythondotnet-owner at python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of PythonDotNet digest..."

Today's Topics:

   1. RunString does not work (Seshagiri Cherukuri)


Message: 1
Date: Sun, 4 Mar 2007 01:37:52 -0800
From: "Seshagiri Cherukuri" <seshagiri.cherukuri at gmail.com>
Subject: [Python.NET] RunString does not work
To: pythondotnet at python.org
 <8d12fba0703040137s728f6848vb061a602472c9490 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

hi All,

I have embedded pythonnet into my C# application and this works great as 
as creating .net objects from python, executing methods etc.
Here I am using the RunSimpleString (the PyRun_SimpleString) wrapper to 
commands from the C# application to the pythonnet.

However I am facing the following problems:

1. After RunSimpleString, PyErr_Occurred or PyErr_Fetch are not able to
detect any exceptions even if they did occur
- for example, consider the code - curErr = PythonEngine.RunSimpleString(
- this code does return a -1 value indicating error.
- however after this none of PyErr_Occurred or PyErr_Fetch do not detect
this error
- from python documentation it looks like there is no way to obtain the
exception information

2. using RunString
- because of above problem I want to send a multi-line code including a
try-except: block
- I have tried using RunString with all the three modes - Py_eval_input,
Py_single_input and Py_file_input
- The RunString works only if the code does not have any .net objects or
does not include any .net exceptions
- If the code sent to RunString includes a .net object e.g. obj, then
RunString always returns in NameError, obj is not defined

3. Strangely, if I run the console application, it is able to work with 
exceptions - both .net and user defined exceptions

4. Is this because of the new dictionary created while in RunString?


Sesh Cherukuri
-------------- next part --------------
An HTML attachment was scrubbed...


PythonDotNet mailing list
PythonDotNet at python.org

End of PythonDotNet Digest, Vol 41, Issue 4

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythondotnet/attachments/20070305/574f99aa/attachment.html 

More information about the PythonDotNet mailing list