Python Script window

<< Click to Display Table of Contents >>

Navigation:  Program Windows >

Python Script window

The Python Script functionality can be enabled/disabled (default) in the Options / Python Script window.

This window allows to create Python scripts (e.g. for testing or control purposes) using the IQRFPY library to communicate with the IQMESH Coordinator via:

oUSB communicating channel

oMQTT channel with a GW based on the IQRF GW Daemon 2.5.0 or higher

 

 

Python including the IQRFPY library is installed (optionally) during IQRF IDE installation.

 

Part of the IQRF IDE is the IQRFIDE Python library, which allows:

oCommunication with the connected IQMESH Coordinator

oPython application interface (API) to some functions of the IQRF IDE. Available Python modules can be also found in the New Python Script Example wizard (menu File / New / Python Script Example...). Use the IQRF IDE API filter to make it easier.

 

Supports:

oPython 3.10 or higher

oDPA 4.17 or higher

 

How to start

 

The window can be opened by:

oTools menu

oToolbar button

oShortcut Ctrl+Alt+P.

oClick or double-click the script file in the Project window

 

The main window consists of 2 parts:

oInternal Editor

Displays selected script

Allows script editing (if the Internal Editor is selected, otherwise it is read-only)

oPython Output

Displays the script output including possible errors and system information relating to the Python scripting.

Control panel

If the icons are inactive, check if the scripting is enabled.

 

 

* available with internal editor only

 

Double-click the file name (see picture above) to open the file in the external editor (if used).

 

The splitter between the window parts allows for changing their size. Double-click the splitter to quickly change sizes in 1/4 : 3/4 ratio and vice versa.

 

The size of both window parts can be quickly changed in 1/4 : 3/4 ratio and vice versa:

oDouble-click the splitter between the window parts.

oDouble-click the header of a given window part.

 

Editor status bar

 

* available with internal editor only

 

Meaning of text indicator colors

 

 

Script example

 

Editor hot keys

 

Python Install Package window (PIP)