Without a concurrent write access can cause unpredictable behaviour or even an segmentation fault of complete application. You should always lock a mutex before access any data. Most important features are the mutex methods. To control data access and adjust the user interface additional features are available. To use own functions and classes in Python macros, the classes/functions had to be defined in a separate file and this file had to be imported in your python application. That Python command has limitations in defining own functions or classes. Python macros executed by the LayoutEditor will be run with the exec(.) command from Python. This simple example will add a box to the current cell on the active layer. addCellref( c, p1) 15 16 # full scale of the view 17 layout. box() 9 10 #adding a cell reference 11 c= layout. A simple python macro would look like this:ġ #!use python 2 #name=#1: Python Exsample 1 3 #help=Helptext for Sample 1 4 5 #adding a box 6 layout. One difference is, that python macros must contain the word 'python' in the first line to be recognize as a python macro. There are only a few python specific differences. The application interface has the same structure. Python macros can be used in the same way as C/C++ macros. The Windows-installer as well as the Windows XP packages do not include any scripting. It is includes in any Linux and Mac package as well as the ZIP packages for Windows. LayoutEditor for Python is shipped with the LayoutEditor in most packages. Review this script is also a good start to learn LayoutEditor for python. The 'layout.py' ( layout.pyw) script build a complete LayoutEditor application from python. A LayoutEditor full version license key had to be registered inside the normal LayoutEditor before loading the module. To use it a stand alone python script the environment variables PYTHONHOME, PYTHONPATH, PATH and LD_LIBRARY_PATH had to be set correctly. Script using pylayout can be started from the integrated TextEditor with the execute button without any further setup. The LayoutEditor Python module is named pylayout.
0 Comments
Leave a Reply. |