Hi Everyone,
I just found out python for .net yesterday and
would be interested in knowing about this. I have
tried to test it myself however, i couldn't figure out
what is wrong with the code i wrote. I am trying to
invoke a simple method hello() from Hello.py
here is the code i wrote:
namespace PyWrapper
{
class Program
{
static void Main(string[] args)
{
PythonEngine.Initialize();
PyObject sys =
PythonEngine.ImportModule("sys");
string actual_path =
sys.GetAttr("path").ToString();
Console.WriteLine(actual_path);
string path = "my path to the py file";
PyObject hello =
PythonEngine.ImportModule("hello");
// PyObject hello remins null after the
line above which i suspect that is the reason the next
line crashes.
string fromPython =
hello.InvokeMethod("hello", new PyTuple()).ToString();
PythonEngine.Shutdown();
}
}
}
Can someone give me some suggestion on what kind of
problem this could be? thanks
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
_________________________________________________
Python.NET mailing list - [email protected]
http://mail.python.org/mailman/listinfo/pythondotnet