Running Scripts

PyScripter

Running Scripts
Previous Top Next

There are many ways of running Python scripts from PyScripter:
·     Debug using the internal integrated Python debugger (depricated)
Set any breakpoints you need and then from the Run menu select the Debug command.  All the debugging facilities (step-into, step-out etc.) are available in this case.  When the execution stops at a breakpoint or while stepping through the code you can use the Call Stack window, the Variables window and the Watches window to better understand the behavior of your code.  All output is redirected to the Interpreter window.  You can also use the Interpreter Window while debugging for running Python code in the context of the Call Stack frame at which the execution stopped for example if you want to change the value of a variable.

You can also start debugging by using the "Step-Into" and the "Run to Cursor" commands of of the Run menu.  In that case executions stops at the first executable statement or the current line of the active module.
            
·     Run without debugging using the internal Python interpreter (depricated)
Select the Run command from the Run menu.  All output is again redirected to the Interpreter Window.

·     Run or debug using one of the remote Python engines
Select an appropriate remote Python engine from the Python Engine submenu of the Run menu
Then run or debug as when using the internal Python engine.  See the Remote Python Engine topic for details.

·     Run externally from PyScripter
Select the External Run command from the Run menu.  Extensive customization (choice of interpreter, command-line, environment variables etc.) is available through the Configure External Run command.  The various settings are the same as in the External Tools configuration.  By default output is captured and shown at the Output window.

For the first two cases you can set command line parameter using the Command Line command. 

In addition, using the Project Explorer, you can create multiple Run Configurations with some more advanced options.