{"id":46768,"date":"2026-09-14T14:14:49","date_gmt":"2026-09-14T14:14:49","guid":{"rendered":"https:\/\/imperix.com\/doc\/?p=46768"},"modified":"2026-09-14T12:00:00","modified_gmt":"2026-09-14T12:00:00","slug":"getting-started-with-python-scripting","status":"publish","type":"post","link":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting","title":{"rendered":"Getting started with Python scripting"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 ez-toc-wrap-right-text counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Choosing-a-Python-scripting-environment\" >Choosing a Python scripting environment<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Cockpits-built-in-script-launcher\" >Cockpit&#8217;s built-in script launcher<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Standalone-Python-environment\" >Standalone Python environment<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Launching-Python-scripts-from-Cockpit\" >Launching Python scripts from Cockpit<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Setting-up-a-standalone-Python-environment\" >Setting up a standalone Python environment<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Installing-Python\" >Installing Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Creating-a-Python-virtual-environment\" >Creating a Python virtual environment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Installing-the-imperix-Python-library\" >Installing the imperix Python library<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Running-the-Hello-World-script\" >Running the Hello World script<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Working-with-Python-in-Visual-Studio-Code\" >Working with Python in Visual Studio Code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\/#Going-further\" >Going further<\/a><\/li><\/ul><\/nav><\/div>\n\n<p class=\"wp-block-paragraph\">Imperix <a href=\"https:\/\/imperix.com\/doc\/help\/cockpit-user-guide\" data-type=\"link\" data-id=\"https:\/\/imperix.com\/doc\/help\/cockpit-user-guide?currentThread=b-box-4\">Cockpit<\/a> provides a graphical interface for managing real-time control software running on imperix controllers. It supports a wide range of actions, from testing transient response and tuning control parameters to long-term monitoring and logging. While direct interaction with the software suits most experiments, highly iterative manipulations can still be tiresome.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Starting with version 2026.3, the <a href=\"https:\/\/imperix.com\/software\/acg-sdk\/\">ACG SDK<\/a> and <a href=\"https:\/\/imperix.com\/software\/cpp-sdk\/$\">CPP SDK<\/a> include a <strong>Python library<\/strong> that provides programmatic access to Cockpit. This enables fully automated tasks in Cockpit using Python scripts. With them, users can easily run commands to repeat operations, make decisions based on collected data, and interface with third-party software. Scripting also enables automated data processing and export without manual intervention.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/imperix.com\/doc\/python-library\">API documentation<\/a> provides ready-to-use code snippets and a complete reference of all available classes and methods. Respectively, this note introduces the basic structure of a script and explains how to run it either directly from Cockpit or from a standalone Python environment. A more complete, application-focused example is available in <a href=\"https:\/\/imperix.com\/doc\/help\/automate-parameter-sweeps-in-python\" data-type=\"link\" data-id=\"https:\/\/imperix.com\/doc\/help\/automate-parameter-sweeps-in-python\">PN205<\/a> and demonstrates using Python to sweep controller parameters to tune a PI controller.<\/p>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-info\" role=\"alert\">Python script runs on the PC and controls the experimental workflow through Cockpit. The real-time control code still runs on the imperix controller and cannot be written in Python. Instead, it must be developed with the ACG SDK, using <a href=\"https:\/\/imperix.com\/doc\/help\/simulation-essentials-simulink\">Simulink<\/a> or <a href=\"https:\/\/imperix.com\/doc\/help\/simulation-essentials-plecs\">PLECS<\/a>, or in C\/C++.<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Choosing-a-Python-scripting-environment\"><\/span>Choosing a Python scripting environment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Python scripts can be executed using Cockpit&#8217;s built-in launcher or from a standalone Python environment. The built-in launcher is recommended for evaluating the global approach, developing very simple scripts, or executing existing scripts without the overhead of installing additional software. Beyond that, switching to a dedicated Integrated Development Environment (IDE) with a standalone Python environment is highly recommended.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Cockpits-built-in-script-launcher\"><\/span><strong>Cockpit&#8217;s built-in script launcher<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Cockpit&#8217;s script launcher requires zero configuration. The execution environment and the Python library are bundled in the SDK, meaning there is no need to install Python or configure system paths separately.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, Cockpit does not include a code editor, so scripts must be written in a separate text editor, such as Notepad++. Additionally, execution is limited to a single <code>.py<\/code> file at a time.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"518\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-11-1024x518.png\" alt=\"\" class=\"wp-image-48909\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-11-1024x518.png 1024w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-11-300x152.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-11-768x388.png 768w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-11.png 1044w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Cockpit built-in Python script launcher<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Standalone-Python-environment\"><\/span>Standalone <strong>Python environment<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Setting up a standalone Python environment enables suing dedicated IDEs such as VS code. The initial setup is slightly more involved, as it requires installing Python independently, choosing an IDE, configuring a working environment, and manually installing the imperix Python library. On the other hand, these editors provide syntax highlighting, intelligent auto-completion, debugging tools, and support for structuring complex, multi-file projects, resulting in a much better user experience overall.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"561\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-21.png\" alt=\"\" class=\"wp-image-48995\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-21.png 773w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-21-300x218.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-21-768x557.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><figcaption class=\"wp-element-caption\">imperix Python library used in VS Code<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 id=\"launch_from_cockpit\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Launching-Python-scripts-from-Cockpit\"><\/span>Launching Python scripts from Cockpit<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In Cockpit, the Python script launcher can be accessed by navigating to the <strong>Python scripting<\/strong> tab and selecting <strong>Launch script<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"634\" height=\"544\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/opening_script_launcher.jpg\" alt=\"\" class=\"wp-image-49259\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/opening_script_launcher.jpg 634w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/opening_script_launcher-300x257.jpg 300w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><figcaption class=\"wp-element-caption\">Opening Cockpit&#8217;s Python script launcher<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The script launcher window allows creating <strong>virtual environments<\/strong>. A Python&nbsp;virtual environment is an isolated workspace where scripts run. Each environment uses its own Python version (e.g. 3.14.6 in the screenshots) and its own set of <strong>packages<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Virtual environments created from Cockpit already include the imperix library. If additional packages are required, they can be installed via the Packages area.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"653\" height=\"615\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-10.png\" alt=\"\" class=\"wp-image-48906\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-10.png 653w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-10-300x283.png 300w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><figcaption class=\"wp-element-caption\">Python packages installation from the script launcher<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The <code>hello-world.py<\/code> script provided below illustrates the basic structure of an imperix Python script and provides a simple way to verify that the scripting environment works correctly. This script instructs Cockpit to refresh its target list, retrieves the list of detected targets, and displays their hostnames and IP addresses,  similar to the list shown in the <em>Targets <\/em>perspective of Cockpit.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>from imperix import Cockpit\n\nwith Cockpit() as cockpit:\n    print(\"Refreshing target list...\")\n    cockpit.targets.refresh()\n\n    targets = cockpit.targets.list()\n    print(f\"{len(targets)} target(s) found:\")\n\n    for target in targets:\n        print(f\"  {target.hostname} ({target.ip})\")<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D73A49\">from<\/span><span style=\"color: #24292E\"> imperix <\/span><span style=\"color: #D73A49\">import<\/span><span style=\"color: #24292E\"> Cockpit<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D73A49\">with<\/span><span style=\"color: #24292E\"> Cockpit() <\/span><span style=\"color: #D73A49\">as<\/span><span style=\"color: #24292E\"> cockpit:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">print<\/span><span style=\"color: #24292E\">(<\/span><span style=\"color: #032F62\">&quot;Refreshing target list...&quot;<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    cockpit.targets.refresh()<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    targets <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> cockpit.targets.list()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">print<\/span><span style=\"color: #24292E\">(<\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;<\/span><span style=\"color: #005CC5\">{len<\/span><span style=\"color: #24292E\">(targets)<\/span><span style=\"color: #005CC5\">}<\/span><span style=\"color: #032F62\"> target(s) found:&quot;<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #D73A49\">for<\/span><span style=\"color: #24292E\"> target <\/span><span style=\"color: #D73A49\">in<\/span><span style=\"color: #24292E\"> targets:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #005CC5\">print<\/span><span style=\"color: #24292E\">(<\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;  <\/span><span style=\"color: #005CC5\">{<\/span><span style=\"color: #24292E\">target.hostname<\/span><span style=\"color: #005CC5\">}<\/span><span style=\"color: #032F62\"> (<\/span><span style=\"color: #005CC5\">{<\/span><span style=\"color: #24292E\">target.ip<\/span><span style=\"color: #005CC5\">}<\/span><span style=\"color: #032F62\">)&quot;<\/span><span style=\"color: #24292E\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-info\" role=\"alert\">The Hello World script is also available in the <a href=\"https:\/\/imperix.com\/doc\/python-library\/helloworld.html\">API documentation<\/a>.<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">To run the Hello World example, or any other script, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Select a virtual environment. If none exists, create a new one.<\/li>\n\n\n\n<li>For this example, no extra packages are required. If another script is being run and requires additional packages, make sure to install them.<\/li>\n\n\n\n<li>Create a new file named <code>hello-world.py<\/code> using a text editor (e.g., Notepad++) and paste the code from the code snippet above.<\/li>\n\n\n\n<li>Browse to select the newly created <code>.py<\/code> script, then click Run. At this point, the list of available targets should be displayed in the output window.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"526\" height=\"436\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-19.png\" alt=\"\" class=\"wp-image-48961\" style=\"width:500px;height:auto\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-19.png 526w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-19-300x249.png 300w\" sizes=\"auto, (max-width: 526px) 100vw, 526px\" \/><figcaption class=\"wp-element-caption\"><code>hello-world.py<\/code> executed from the script launcher<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 id=\"external_python\" class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Setting-up-a-standalone-Python-environment\"><\/span>Setting up a standalone Python environment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Configuring an external Python environment is a prerequisite before integrating an IDE such as VS Code.<\/p>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-info\" role=\"alert\">This step-by-step guide is designed for Python beginners. Experienced users who only require a quick reference can refer directly to the <a href=\"https:\/\/imperix.com\/doc\/python-library\/installation.html\">installation<\/a> page of the API documentation.<\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Installing-Python\"><\/span>Installing Python<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The imperix Python library requires Python 3.11 or later. It can be installed by following the official <a href=\"https:\/\/docs.python.org\/3\/using\/windows.html\">Python guide for Windows<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To verify that Python was properly installed, open a terminal (either Command Prompt or PowerShell) and run the following command:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>python --version<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #24292E\">python --version<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">It should display the active Python version. If Python is missing or not added to the system PATH, an error will indicate that the term &#8220;python&#8221; is not recognized. In this case, the <a href=\"https:\/\/docs.python.org\/3\/using\/windows.html#troubleshooting\">troubleshooting section<\/a> of the official guide may help to resolve it.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"286\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-25.png\" alt=\"\" class=\"wp-image-49012\" style=\"width:490px;height:auto\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-25.png 610w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-25-300x141.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><figcaption class=\"wp-element-caption\">Verification that Python is installed<\/figcaption><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Creating-a-Python-virtual-environment\"><\/span>Creating a Python virtual environment<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A Python virtual environment is an isolated workspace where scripts run. Each environment uses its own Python version and package set. Creating and activating Python virtual environments is optional but highly recommended, since it provides isolation between projects and consistency over time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To learn more about virtual environments, refer to the <a href=\"https:\/\/docs.python.org\/3\/library\/venv.html\">official Python documentation<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To create and activate a virtual environment:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open a terminal in the project directory\n<ol class=\"wp-block-list\">\n<li>Right-click inside the folder and select <strong>Open in Terminal<\/strong>, or<\/li>\n\n\n\n<li>Navigate to the directory manually using:<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>cd C:\\path\\to\\director<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D73A49\">cd<\/span><span style=\"color: #24292E\"> C:\\path\\to\\director<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Create a virtual environment by running the following command. A folder named <code>.venv<\/code> will be created in the project directory.<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly> python -m venv .venv<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #24292E\"> python -m venv .venv<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Activate it by running<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>.venv\\Scripts\\Activate<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #24292E\">.venv\\Scripts\\Activate<\/span><\/span><\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"673\" height=\"324\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-29.png\" alt=\"\" class=\"wp-image-49774\" style=\"width:585px;height:auto\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-29.png 673w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-29-300x144.png 300w\" sizes=\"auto, (max-width: 673px) 100vw, 673px\" \/><figcaption class=\"wp-element-caption\">Creation and activation of a Python virtual environment<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Once activated, the terminal prompt displays <code>(.venv)<\/code> at the beginning of the line. Packages installed via <code>pip<\/code> (Python&#8217;s package manager) are confined exclusively to the active virtual environment and will not affect the global system installation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To exit the virtual environment, run: <code>deactivate<\/code><\/p>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-info\" role=\"alert\"><strong>PowerShell Security Error<\/strong><br>If running <code>Activate.ps1<\/code> produces a <code>PSSecurityException<\/code> error, PowerShell might be blocking script execution. Allowing the execution of scripts can be done by running the following command:<br><br><code>Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser<\/code><br><br>Alternatively, Window&#8217;s Command Prompt (cmd) can be used instead.<br><br>See <a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/module\/microsoft.powershell.core\/about\/about_execution_policies?view=powershell-7.6\">about execution policies<\/a> to learn more.<\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Installing-the-imperix-Python-library\"><\/span>Installing the imperix Python library<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To install the imperix Python library, download&nbsp;<code>imperix_python_library_vX.X.X.zip<\/code> from the <a href=\"https:\/\/imperix.com\/doc\/python-library\/installation.html\">installation<\/a> page and install using <code>pip<\/code> by running the following command. If using a virtual environment, make sure it is activated (the terminal prompt displays <code>(.venv)<\/code>)<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>python -m pip install \"C:\\path\\to\\imperix_python_library_vX.X.X.zip\"<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #24292E\">python -m pip install <\/span><span style=\"color: #032F62\">&quot;C:\\path\\to\\imperix_python_library_vX.X.X.zip&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-info\" role=\"alert\">The full path can be retrieved by right-clicking the zip file and selecting <strong>Copy as path<\/strong>.<\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"682\" height=\"476\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-27.png\" alt=\"\" class=\"wp-image-49267\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-27.png 682w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-27-300x209.png 300w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><figcaption class=\"wp-element-caption\">Installation of the imperix library in the virtual environment (.venv)<\/figcaption><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Running-the-Hello-World-script\"><\/span>Running the Hello World script<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To verify that everything was installed properly, run the Hello World script.<\/p>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-info\" role=\"alert\">The Hello World script code is available in the <em>Launching Python scripts from Cockpit<\/em> section above, as well as in the <a href=\"https:\/\/imperix.com\/doc\/python-library\/helloworld.html\">API documentation<\/a>.<\/div>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a new file named <code>hello-world.py<\/code> using a text editor (e.g., Notepad++) and paste the code from the code snippet provided <a href=\"#launch_from_cockpit\" data-type=\"internal\" data-id=\"#launch_from_cockpit\">above<\/a>.<\/li>\n\n\n\n<li>Run the script using the command below. The output should provide the list of available targets.<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>python hello-word.py<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #24292E\">python hello-word.py<\/span><\/span><\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"691\" height=\"248\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-22.png\" alt=\"\" class=\"wp-image-48998\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-22.png 691w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-22-300x108.png 300w\" sizes=\"auto, (max-width: 691px) 100vw, 691px\" \/><figcaption class=\"wp-element-caption\">Running <code>hello-world.py<\/code> from a terminal<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Working-with-Python-in-Visual-Studio-Code\"><\/span>Working with Python in Visual Studio Code<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Visual Studio Code (or VS Code) is an open-source code editor developed by Microsoft. This editor is used as an example, as it is currently the most widely adopted IDE for Python development. However, other popular IDEs, such as PyCharm or Spyder, can work just as well.<\/p>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-info\" role=\"alert\">Before configuring VS Code, set up a standalone Python environment as explained above.<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The installer is available from the official <a href=\"https:\/\/code.visualstudio.com\/download\">download page<\/a>. After installing and launching the editor, the Python extension can be installed from the <em>Extensions<\/em> tab on the left (<code>Ctrl+Shift+X<\/code>). This extension provides code completion, debugging tools, and other features, which are described further in the <a href=\"https:\/\/code.visualstudio.com\/docs\/languages\/python\">Python in VS Code<\/a> documentation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"877\" height=\"577\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-28.png\" alt=\"\" class=\"wp-image-49270\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-28.png 877w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-28-300x197.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-28-768x505.png 768w\" sizes=\"auto, (max-width: 877px) 100vw, 877px\" \/><figcaption class=\"wp-element-caption\">Installing the Python extension in Visual Studio Code<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next, open or create a project folder (such as the directory containing hello-world.py) and launch a terminal there. A project folder serves as the working directory containing all Python scripts (.py) and the associated virtual environment.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>After installing the Python extension, close and reopen VS Code to make sure Python is properly detected<\/li>\n\n\n\n<li>Open a project folder  by selecting <code>File &gt; Open Folder<\/code><\/li>\n\n\n\n<li>Open a Terminal by selecting <code>View &gt; Terminal<\/code>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If the project folder contains a virtual environment, VS Code should automatically detect it and activate it, as illustrated below (the line starts with (<code>.venv)<\/code>). If not, the virtual environment can be manually selected as follows:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Navigate to <code>Help &gt; Show All Commands<\/code> (or press <code>Ctrl+Shift+P<\/code>)<\/li>\n\n\n\n<li>Type and select <strong>Python: Select Interpreter<\/strong><\/li>\n\n\n\n<li>Choose the Python executable inside the <code>.venv<\/code> folder (e.g., <code>.\\.venv\\Scripts\\python.exe<\/code>).<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-info\" role=\"alert\">The <strong>Python: Select Interpreter<\/strong> command also enables creating new virtual environments directly, without executing terminal commands.<\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"801\" height=\"597\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-23.png\" alt=\"\" class=\"wp-image-49007\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-23.png 801w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-23-300x224.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-23-768x572.png 768w\" sizes=\"auto, (max-width: 801px) 100vw, 801px\" \/><figcaption class=\"wp-element-caption\">Opening a project folder in Visual Studio Code (here <code>.venv<\/code> is detected and automatically activated)<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To verify the installation,  run the <code>hello-world.py<\/code>  script using the following command. Alternatively, click the play button (\u25b6) on the top right.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>python hello-world.py<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #24292E\">python hello-world.py<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"571\" src=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-24.png\" alt=\"\" class=\"wp-image-49008\" srcset=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-24.png 800w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-24-300x214.png 300w, https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/image-24-768x548.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Running <code>hello-world.py<\/code> from Visual Studio Code<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Going-further\"><\/span>Going further<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/imperix.com\/doc\/help\/automate-parameter-sweeps-in-python\">PN205<\/a> example presents a complete script that updates the <code>Kp<\/code> and <code>Ki<\/code> parameters and acquires the resulting response to a current reference step. This example serves as a practical template for building automation sequences and provides guidelines on the following key concepts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Creating a project and launching user code.<\/li>\n\n\n\n<li>Configuring the Scope module.<\/li>\n\n\n\n<li>Performing the experiment and exporting the resulting acquired data .<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Imperix Cockpit provides a graphical interface for managing real-time control software running on imperix controllers. It supports a wide range of actions, from testing transient&#8230;<\/p>\n","protected":false},"author":4,"featured_media":49911,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[3],"tags":[184],"software-environments":[],"provided-results":[],"related-products":[],"guidedreadings":[],"tutorials":[],"user-manuals":[],"coauthors":[70,173],"class_list":["post-46768","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-help","tag-python"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Getting started with Python scripting - imperix<\/title>\n<meta name=\"description\" content=\"Learn imperix Python scripting with a Hello World example using Cockpit or an external Python environment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting started with Python scripting - imperix\" \/>\n<meta property=\"og:description\" content=\"Learn imperix Python scripting with a Hello World example using Cockpit or an external Python environment.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting\" \/>\n<meta property=\"og:site_name\" content=\"imperix\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-14T14:14:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/Feat_img_getting_started_python_2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"450\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Beno\u00eet Steinmann, Jules Perrin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Beno\u00eet Steinmann, Jules Perrin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting\"},\"author\":{\"name\":\"Beno\u00eet Steinmann\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/person\\\/a69a3bda75b05d0923cc76d7268cc94f\"},\"headline\":\"Getting started with Python scripting\",\"datePublished\":\"2026-09-14T14:14:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting\"},\"wordCount\":1565,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/Feat_img_getting_started_python_2.png\",\"keywords\":[\"python\"],\"articleSection\":[\"Product notes\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting\",\"name\":\"Getting started with Python scripting - imperix\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/Feat_img_getting_started_python_2.png\",\"datePublished\":\"2026-09-14T14:14:49+00:00\",\"description\":\"Learn imperix Python scripting with a Hello World example using Cockpit or an external Python environment.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting#primaryimage\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/Feat_img_getting_started_python_2.png\",\"contentUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/Feat_img_getting_started_python_2.png\",\"width\":450,\"height\":300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/help\\\/getting-started-with-python-scripting#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Knowledge base\",\"item\":\"https:\\\/\\\/imperix.com\\\/doc\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Product notes\",\"item\":\"https:\\\/\\\/imperix.com\\\/doc\\\/category\\\/help\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Getting started with Python scripting\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#website\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/\",\"name\":\"imperix\",\"description\":\"power electronics\",\"publisher\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/imperix.com\\\/doc\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#organization\",\"name\":\"imperix\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/imperix_logo.png\",\"contentUrl\":\"https:\\\/\\\/imperix.com\\\/doc\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/imperix_logo.png\",\"width\":350,\"height\":120,\"caption\":\"imperix\"},\"image\":{\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/imperix.com\\\/doc\\\/#\\\/schema\\\/person\\\/a69a3bda75b05d0923cc76d7268cc94f\",\"name\":\"Beno\u00eet Steinmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g3b3f3d8e66019ebcb2848094940b98c0\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g\",\"caption\":\"Beno\u00eet Steinmann\"},\"description\":\"Benoit is an embedded systems expert and the leader of software and firmware developments at imperix. On the knowledge base, he is the author of numerous software reference documents.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/benoit-steinmann\\\/\"],\"url\":\"https:\\\/\\\/imperix.com\\\/doc\\\/author\\\/steinmann\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting started with Python scripting - imperix","description":"Learn imperix Python scripting with a Hello World example using Cockpit or an external Python environment.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting","og_locale":"en_US","og_type":"article","og_title":"Getting started with Python scripting - imperix","og_description":"Learn imperix Python scripting with a Hello World example using Cockpit or an external Python environment.","og_url":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting","og_site_name":"imperix","article_published_time":"2026-09-14T14:14:49+00:00","og_image":[{"width":450,"height":300,"url":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/Feat_img_getting_started_python_2.png","type":"image\/png"}],"author":"Beno\u00eet Steinmann, Jules Perrin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Beno\u00eet Steinmann, Jules Perrin","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting#article","isPartOf":{"@id":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting"},"author":{"name":"Beno\u00eet Steinmann","@id":"https:\/\/imperix.com\/doc\/#\/schema\/person\/a69a3bda75b05d0923cc76d7268cc94f"},"headline":"Getting started with Python scripting","datePublished":"2026-09-14T14:14:49+00:00","mainEntityOfPage":{"@id":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting"},"wordCount":1565,"commentCount":0,"publisher":{"@id":"https:\/\/imperix.com\/doc\/#organization"},"image":{"@id":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting#primaryimage"},"thumbnailUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/Feat_img_getting_started_python_2.png","keywords":["python"],"articleSection":["Product notes"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting#respond"]}]},{"@type":"WebPage","@id":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting","url":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting","name":"Getting started with Python scripting - imperix","isPartOf":{"@id":"https:\/\/imperix.com\/doc\/#website"},"primaryImageOfPage":{"@id":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting#primaryimage"},"image":{"@id":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting#primaryimage"},"thumbnailUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/Feat_img_getting_started_python_2.png","datePublished":"2026-09-14T14:14:49+00:00","description":"Learn imperix Python scripting with a Hello World example using Cockpit or an external Python environment.","breadcrumb":{"@id":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting#primaryimage","url":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/Feat_img_getting_started_python_2.png","contentUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2026\/07\/Feat_img_getting_started_python_2.png","width":450,"height":300},{"@type":"BreadcrumbList","@id":"https:\/\/imperix.com\/doc\/help\/getting-started-with-python-scripting#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Knowledge base","item":"https:\/\/imperix.com\/doc\/"},{"@type":"ListItem","position":2,"name":"Product notes","item":"https:\/\/imperix.com\/doc\/category\/help"},{"@type":"ListItem","position":3,"name":"Getting started with Python scripting"}]},{"@type":"WebSite","@id":"https:\/\/imperix.com\/doc\/#website","url":"https:\/\/imperix.com\/doc\/","name":"imperix","description":"power electronics","publisher":{"@id":"https:\/\/imperix.com\/doc\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/imperix.com\/doc\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/imperix.com\/doc\/#organization","name":"imperix","url":"https:\/\/imperix.com\/doc\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/imperix.com\/doc\/#\/schema\/logo\/image\/","url":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/03\/imperix_logo.png","contentUrl":"https:\/\/imperix.com\/doc\/wp-content\/uploads\/2021\/03\/imperix_logo.png","width":350,"height":120,"caption":"imperix"},"image":{"@id":"https:\/\/imperix.com\/doc\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/imperix.com\/doc\/#\/schema\/person\/a69a3bda75b05d0923cc76d7268cc94f","name":"Beno\u00eet Steinmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g3b3f3d8e66019ebcb2848094940b98c0","url":"https:\/\/secure.gravatar.com\/avatar\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/22a9252907f853f91d07b143dfcc84f6ec0cc31f6b72408b503a7026eed5b109?s=96&d=mm&r=g","caption":"Beno\u00eet Steinmann"},"description":"Benoit is an embedded systems expert and the leader of software and firmware developments at imperix. On the knowledge base, he is the author of numerous software reference documents.","sameAs":["https:\/\/www.linkedin.com\/in\/benoit-steinmann\/"],"url":"https:\/\/imperix.com\/doc\/author\/steinmann"}]}},"_links":{"self":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts\/46768","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/comments?post=46768"}],"version-history":[{"count":249,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts\/46768\/revisions"}],"predecessor-version":[{"id":47629,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/posts\/46768\/revisions\/47629"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/media\/49911"}],"wp:attachment":[{"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/media?parent=46768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/categories?post=46768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/tags?post=46768"},{"taxonomy":"software-environments","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/software-environments?post=46768"},{"taxonomy":"provided-results","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/provided-results?post=46768"},{"taxonomy":"related-products","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/related-products?post=46768"},{"taxonomy":"guidedreadings","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/guidedreadings?post=46768"},{"taxonomy":"tutorials","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/tutorials?post=46768"},{"taxonomy":"user-manuals","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/user-manuals?post=46768"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/imperix.com\/doc\/wp-json\/wp\/v2\/coauthors?post=46768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}