The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Accessing Origin Sheets in Python

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000