05-28-2010 03:59 AM
Hi,
I hope someone can help.
I am using CVI for the first time almost (5 years since I did any coding) but now all round there is python code and some functions would be good to use again.
Is it possible to reuse this python code and if so how?
Thanks
Simon
05-28-2010 11:40 AM
CVI is C-based, Python is an OO language unlike C.
There is Cython, which is C generated from Python, so you could take your Python code, automaticaly generate Cython from it, then try and compile that in the CVI environment.
Or, if you can build a DLL from Python, you could call it from your CVI application.
Or, if your Python code can be made into a stand alone application , you could invoke it (schedule it) from C code written as a CVI project.
Menchar
05-28-2010 11:55 AM
To clarify -
See www.cython.org
Cython is Python with support for C data types.
You can invoke Python/Cython from C very essily, according to the Cython wiki here:
I'd say leave the Python code as Python if possible, and call it however Cython describes. If that doesn't work, convert the Python to Cython and then call the Cython from C.
Menchar