Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am new with vb.net. I am trying to call python functions from vb.net but getting error that 'Invoke' is not a member of 'Microsoft.Scripting.Hosting.ObjectOperations'

Imports Microsoft.Scripting
Imports Microsoft.Scripting.Hosting
Imports IronPython.Hosting
Sub Main
 Dim engine As ScriptEngine
        Dim scope As ScriptScope
        Dim i As Integer


        engine = Python.CreateEngine()
        scope = engine.ExecuteFile("C:\Working.py")
 Dim v = engine.Operations.Invoke(scope.GetVariable(methodName))

' name of the method thaT NEEDS TO INVOKED AND GET THE RETURN VALUE. Can anyone please recommend me better way to make this work? I have already seen this link :http://msmvps.com/blogs/theproblemsolver/archive/2008/08/14/calling-ironpython-functions-from-net.aspx

Thank you in advance.

share|improve this question
    
Here is a link to a blog about using the dynamic keyword to execute Python methods, simple-talk.com/dotnet/.net-framework/… Also, VB6 has nothing to do with VB.NET, you might want to edit your tags. –  jac Jun 4 at 3:41
    
Thanks for the link! But i was looking for answer in vb.net language. Cannot create the Python engine and scope objects in vb.net. –  user2801184 Jun 6 at 0:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.