Can I use input fields in my scripts?
Input fields (in GUI mode) provides the possibility to get user input during the execution of a DPL script. This can be part of a user communication while the script is running and can be used to enter a text/path/number etc.
In PowerFactory, input fields are also available for scripting:
- DPL: A dedicated method called input() exists to pause the script and create an input box for user input (see DPL reference)
- Python: No method exists, but by using a DPL subscript the input() method can also be used
The attached project contains a Python script (located in the project Library in the folder Scripts) that does the following tasks:
- Executing a DPL script from its contents which calls the input() method to open up a dialog box
- After the user has entered a text, the string is written into a DPL vector
- The DPL vector is read by the Python script and the entered text is written into the Output Window
This way user input is possible during the execution of a Python script, which can be further processed afterwards.