Greatly Improved Python Support in Origin 2021

Origin 2021 introduces significant improvements for programming with Python. These improvements include:

  • A new originpro package for easy access to Origin objects.
  • Improved Python IDE, including IntelliSense and debugging.
  • Script and GUI control to install and manage Python packages.
  • Access to Python functions from Column Formula, Fitting Functions, and Text Objects.
  • Access to Python functions from Labtalk and Origin C.

This blog shows you various resources that you can make use of, to get started with using Python in Origin 2021.

First of all, as a brief overview, I list the several Places in Origin 2021 that Python can be used:

  • Code Builder: Select menu Connectivity: Open Untitled.py… to code a Python file in Code Builder window. Note that Python IDE now supports IntelliSense and debugging.

  • Set Column Value Dialog: Create Python function which can be immediately accessed in column formula.


  • Text Objects: Python function can be embedded in a text object in worksheet. Then the function can be called from another button object.



  • Python in FDF for Fast Fitting
Add a Python section in your FDF file
Directly call it in the FDF body
Run it as usual

Below are the document pages from where you can start to learn various usage of Python I have shown above:

  1. If you are new to Python in Origin, please check the page below, where you can find answers to the general questions such as what does the new originpro package offer, how to run Python script in Origin and how to install Python packages in Origin:
    https://www.originlab.com/doc/python/originpro/New-originpro-package-for-easy-access-to-Python

  2. Once you have learnt how to run Python script in Origin, the document pages below with sample Python scripts can be good practice for you to start coding with Python in Origin.
    https://www.originlab.com/doc/python/originpro/Python-Examples-using-originpro
    https://www.originlab.com/doc/python/originpro/Sample-Projects-with-attached-Python-Code
    Detailed reference to originpro module can be found at:
    https://www.originlab.com/python/doc/originpro/annotated.html

  3. To call Python functions from Labtalk or Origin C, please refer to the following pages:
    https://www.originlab.com/doc/python/originpro/Calling-Python-Functions-from-LabTalk-and-Column-Formula
    https://www.originlab.com/doc/python/originpro/Calling-Python-Functions-from-Origin-C

  4. Python-based Import Filter:
    http://blog.originlab.com/creating-a-python-based-import-filter-with-origin-2021

Other than the documents mentioned above, we also pre-install multiple Python example projects and workbook templates with Origin 2021. These resources will give you more comprehensive understandings on creating projects combining Python script and Origin functionalities:

  1. Example projects: In Origin workspace, select menu Help:Learning Center (hotkey F11), Select Analysis Samples in the left panel, in the right panel, expand the Samples in dropdown list and select Python, we have a list of Python examples:



  2. Workbook templates: Select from menu File:New:Workbook…. Under System Templates tab, find the workbook templates noted as Python Examples:


  3. Examples under Sample folder: Select from menu Help:Open Folder:Sample Folder, find Python sample projects under Python folder.

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です