T O P I C R E V I E W |
alexander.steppke |
Posted - 10/14/2009 : 11:41:45 AM Origin Ver. and Service Release (Select Help-->About Origin): 8.0 SR6 Operating System: Windows Vista SP1
Hi,
is there any way to use python as a programming language for Origin? We have here some data analysis functions in our department in python and I would like to apply these functions to my Origin Worksheets. At the moment I export as ASCII and re-import the modified file by hand.
With the COM-interface it seems possible to access the Worksheet data, but only if you know the name of the worksheet, so just looping over all open worksheet for example does not work that way.
Might it be possible to embed python into Origin or otherwise apply python functions on worksheets?
Greetings Alexander |
3 L A T E S T R E P L I E S (Newest First) |
eparent |
Posted - 10/23/2009 : 5:03:09 PM Hello,
I have created a Python example that shows how to loop through the WorksheetPages in the current project. http://wiki.originlab.com/~originla/wiki/index.php?title=OriginCOM:Application-WorksheetPages#Python
and there is also a Python example that shows how to put data into a worksheet. http://wiki.originlab.com/~originla/wiki/index.php?title=OriginCOM:Application-PutWorksheet#Python
|
alexander.steppke |
Posted - 10/23/2009 : 09:32:25 AM Hi Sophy,
thank you for your help. I already tried to include Python.h and failed because of the multiple compilation errors.
The method in the wiki with the DLL looks interesting, I will tried it out soon. Is it with this method at all possible to change the Python code afterwards without compiling a new DLL or is it "inside" the DLL then?
My goal is to be able to have some python code than I can easily modify and just type a command to apply this function to the current worksheets. Maybe it is possible to wrap the Python eval function?
Thanks for any further hints.
Alexander |
Sophy |
Posted - 10/23/2009 : 04:07:56 AM Hi, Alexander:
If you just want to process the data in a specific Origin Worksheet, then you should already known the Worksheet's name; and if you only need a tempory Worksheet to store the data, process the data and then retrieve back into Python, why not create a new Worksheet in your Python code :)
For how to reuse your Python code in Origin C, please refer to the following page:
http://ocwiki.originlab.com/index.php?title=OriginC:Calling_Python_via_External_DLL
Hope this will help. |