When you install Origin, Python is also installed. This installation is referred to as Embedded Python, and is independent of any Python versions you may have installed outside of Origin. The current version of Embedded Python is 3.8.3.
An originpro package is also pre-installed for immediate use from the Embedded Python, to interact with Origin object such as worksheets, matrixsheets and graphs.
There are several ways to access Python code from within Origin. The following two sections provide quick examples.
You can execute Python commands in the Python Console in Origin. This is useful if you are executing just a few lines of code.
import originpro as op
Python code can be stored and accessed from several places such as external files, files attached to the Origin project, included in Set Column Values dialog, or stored in text objects in a graph or worksheet window.
In this simple example, we will save our Python code to a .py file and execute it from Origin's Script Window.
print ("Hello World!")
run -pyf "Hello.py"
The message "Hello World!" is returned to the Script Window (see run -pyf).
To learn more about how to use Embedded Python in Origin, please review the following pages: