Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Execute Python code in QM
#19
Executing python function successfully Smile


Macro IPY fun
Code:
Copy      Help
str s.expandpath("$desktop$\IPY\IronPython.dll")
_s=
F
;[reflection.assembly]::LoadFrom("{s}")
;$py = [ironpython.hosting.python]::CreateEngine()
;$pyv = $py.CreateScope()
;$pyc = $py.CreateScriptSourceFromString(    
;"
;def fun():
;;;;;print 'hello from example function'
;");
;$pyc.Execute($pyv)
;$py.Operations.Invoke($pyv.GetVariable("fun"));
PsCmd3 _s "" str's1
mes s1

Remove extra GAC ​​characters  Smile

 [reflection.assembly]::LoadFrom("{s}") | Out-Null


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)