Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Execute Python Code in QM Using python.net
#3
I previously tried having ChatGPT modify the code from that link and ran it in QM, but it was unsuccessful. The code above was also written by ChatGPT, but it is not perfect.

The code in #1 is a static function call, which is simple and straightforward to use.
The LA code uses instance function calls, which is a bit more complicated since you need to create an object first.
I rarely use instance function calls in qm. Can you modify the python.net code from LA to use instance calls in qm?

My ultimate goal is to be able to run Python code in qm like the example below—it’s just so simple to use.

Code:
Copy      Help
str pyCode= 
;def func2(a1, a2):
;;;;;return a1 * a2

str f2="func2"; int a1(6) a2(7)
mes pycall(pyCode, f2, a1, a2)

I found that running Python code in qm is much faster compared to running PowerShell code. Also, various AI programming assistants have the highest accuracy when writing Python code. That’s why I’m very persistent about implementing the approach used in the #1 code above.


Messages In This Thread
RE: Execute Python Code in QM Using python.net - by Davider - 06-08-2025, 06:35 AM
RE: First steps with Python.NET - by Davider - 06-09-2025, 03:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)