Running Python scripts in winIDEA
In this topic:
Python scripts can be executed as a child process of winIDEA. They launch in new console window as new instance of Python interpreter. There can be more than one script executed in batch mode at the same time. winIDEA doesn't interact with these processes, except when we exit winIDEA, when it terminates all of them.
(optional) Modify the script according to the required configuration. |
Save it in the same folder as winIDEA workspace. |
Start Debug session |
Debug status must be STOP.
Select your Python script in Tools / External Scripts. |
The script will execute the required operation.
|
Run Script [F6] - Starts Python script in batch mode. This mode is useful for background tasks, for example read value of variable on a target and log it to file.
Run Script and Wait [Ctrl + F6] - After executing a script, the new console window does not disappear after the script ends but remains open thus leaving access to the current state of Python interpreter in interactive mode.
Stop Script - Terminates scripts started in batch mode. Set focus to the console window running the script and press [Ctrl + Break]. In interactive mode press [Ctrl + Z] to terminate the script.
External Scripts - Quick access to all Python scripts saved in the same folder as the workspace.
Using a keyboard shortcut to run a shortcut script. |
Scripts using winIDEA SDK module can be run from system command prompt, Continuous Integration tool, or from third party IDE, for example Eclipse with PyDev plug-in.
Scripts ran in winIDEA always connect to that instance of winIDEA. When a script is started from another tool, then the script starts and connects to a winIDEA instance, depending on the connection method used in the script. Read more about connection methods...