Вы находитесь на странице: 1из 1

This folder contains examples to show how to work with the embedded Python

environment in Origin.

The examples include Origin project files with Python files attached, and Python
files to be executed directly.

====Help File on Working with Python in Origin====


In Origin, use the "Help:Programming:LabTalk" menu to open the LabTalk CHM.

LabTalk CHM >> LabTalk Scripting Guide >> Working with Python

or

Visit the online documentation center:

http://www.originlab.com/doc/LabTalk/guide/work-with-python

====Run Python Files by LabTalk Script====


In Origin, open the Script Window (Window:Script Window), make sure "Edit: Script
Execution:LabTalk" is selected.

Run the following LabTalk Script to execute the listmember.py file under this
folder.

To run the LabTalk script, highlight them in Script Window and hit Enter.

It will list all the functions/global variables and classes/member functions


accessable from embedded python.

// Begin of Script
string str$ = system.PATH.PROGRAM$ + "\Samples\Python\ListMember.py";
run -pyf "%(str$)"; //will list all functions provided by the PyOrigin module
// End of Script

====Run and View Python File Attached to Origin Project====


In Origin, use "File:Open" menu to open one of the Origin project file in this
folder.

In each file, there will be buttons embedded in worksheet to execute attached


Python file or open it in Code Builder.

Alternatively in each project file, you could open the Code Builder (View: Code
Builder or Alt + 4)

In Code Builder browse to the Project folder in Workspace panel to access the
attached Python file.

Вам также может понравиться