Installing a Python program as a module
To save your Python program as a module:
|
•
|
In the Editor, select . |
After selection, the following occurs:
|
•
|
The Python syntax is checked. |
|
•
|
The file is saved and moved to the PyLib folder. |
|
•
|
A dialog appears confirming that the file has been installed as a module. |
|
•
|
The file is closed and the module is ready for use. |
|
•
|
The module name will be added to the menu with a menu item. |
If you plan to share this module with others, it is recommended that you follow these guidelines:
|
•
|
Store only one module per TNS file. |
|
•
|
The module name matches the name of TNS file (e.g. "my_program" module is in the "my_program.tns" file). |
|
•
|
Add a Notes page before the Python Editor that describes the intent of the module, the version, and the functions. |
|
•
|
Use the ver() function to display the version number of the module. |
|
•
|
(Optional) Add a help function to display the list of methods in the function. |