pyscripter / python4delphi

Free components that wrap up Python into Delphi and Lazarus (FPC)
MIT License
895 stars 307 forks source link

How can I keep resetting the script environment every time I restart the script without dynamically creating it? The global variables of historical scripts will be contaminated. #418

Closed 4302473 closed 1 year ago

4302473 commented 1 year ago
  1. How to use buttons to stop scripts in Delphi, such as when the script is in a loop.

  2. How can I keep resetting the script environment every time I restart the script without dynamically creating it? The global variables of historical scripts will be contaminated.

pyscripter commented 1 year ago
  1. Press the Abort button. If this does not work, then try Run, Python Engine, ReInitialize
  2. By default each time you run a script it runs in a new interpreter. You can control this using Tools, Options, IDE Options, Python Interpreter, "Reinitialize before run"