Re: [Python.NET] Could you tell me how to call python from c#?

2007-06-06 Thread Barrett, Joey
Thanks for working through this with me. Lots of questions, but I promise to write a nice HOW-TO on all this once I get it working from .NET. ... if (module == null) { throw new PythonException(); } catch (PythonException e) { result += e.Message + "\n" + e.StackTrace + "\n" + e.T

Re: [Python.NET] Could you tell me how to call python from c#?

2007-06-06 Thread Barrett, Joey
Thank you for all the help. Loading a module located at C:\test\testModule.py is causing the following error: "Object reference not set to an instance of an object." TestModule.py def testMethod(self, options = {}): m = {} return m The last line of this code throws the error:

Re: [Python.NET] Could you tell me how to call python from c#?

2007-06-06 Thread Michael Eddington
Yes, you can set the PYTHONHOME variable from .net prior to calling the initialize. Many of the python runtimes set registry keys or are located in default locations. mike On 6/6/07, Barrett, Joey <[EMAIL PROTECTED]> wrote: > > Thank you for your response, this is helpful. > > The methods called

Re: [Python.NET] Could you tell me how to call python from c#?

2007-06-06 Thread Barrett, Joey
Thank you for your response, this is helpful. The methods called usually return lists or dictionaries and sometimes other types too that need to be used within the C#. In the example you provided the return value from InvokeMethod(), is a string "fromPython", but I noticed InvokeMethod() actuall