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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Python
 send range to python
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Phillip T.

Germany
19 Posts

Posted - 06/09/2020 :  01:01:18 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I am trying to get python and origin to talk to each other but when i try the syntax of the documentation it does not work.

I want to pass a range to python by:

range pas = MFC_T!MFCTt;
type -b "$(pas)";
Python.send(pas, b);

string py$ = "C:\Users\AG Over\Desktop\Python Projects\FIT IR Temp\Fit_IR_Temp.py";
run -pyf "%(py$)";

the python script is simply "print(b)" for now. the type command shows me that the range is correct but printout only gives the correct result if i set the range to "1!1" otherwise it will put out nothing or nonsense or the old range.

Thank you.

Chris D

428 Posts

Posted - 06/09/2020 :  09:06:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Phillip,

Do you need to parse a range (in string form) into an actual object (e.g. a Worksheet, Column, etc)?

Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

Phillip T.

Germany
19 Posts

Posted - 06/10/2020 :  04:51:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Chris,

i need to get my column into a python object.
I "solved" the problem by just exporting my data and then reimport it into python. But I am still interested in how the python.send command is supposed to work.

Regards,
Phillip
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 06/10/2020 :  10:11:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You want to take data in your worksheet, maybe a single column, to do fitting in your py file and want the result to put into another sheet?

We are now working on higher level approach to transfer with DataFrame or numpy Arrays. Maybe we can send you a beta version so you can try this new approach?

CP
Go to Top of Page

Castiel

343 Posts

Posted - 06/10/2020 :  10:46:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Phillip T.

Hello Chris,

i need to get my column into a python object.
I "solved" the problem by just exporting my data and then reimport it into python. But I am still interested in how the python.send command is supposed to work.

Regards,
Phillip



I suppose the LabTalk object 'python' is for LabTalk users. You can inspect the data in Python Console after calling python.send(...).

Import the builtin python package PyOrigin in your python code to read/write origin data easily.
Go to Top of Page

Phillip T.

Germany
19 Posts

Posted - 06/16/2020 :  02:44:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
@chris

yes this is exactly what i wanted to do.

@cpyang

if it is easy to use for a beginner you are welcome to send me your beta. It is quite possible that i can use it in a future project and get back to you then. Might take a while tho.

please send it to:
phillip.timmer@phys.chemie.uni-giessen.de
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000