python - Run script in interactive namespace from within Canopy -


How to run a Python script inside the current interactive namespace, from inside the Canopy editor?

Specifically, I have a large model object that takes a long time to load. I want to instantiate the model in the interactive shell and then be able to run the script running on the current model. If I select the text in my script and click on the "Run Selected Text" button, then everything works well Alternatively, if I type "run -i script.py" as suggested in this So it works fine then it works fine However, if I click on the "Run the current file" button, the script runs on a clean naming place and no variables in the interactive shell can be found.

This is the specific code that I am trying to use to load the first nearby models only through the script.

  # Presenting model object only if it is not already present if 'model' is not in the local people (): model = tree modal (filename)   

Press the up arrow to memorize the run command, insert -i , and press Enter to run again in the interactive mode of iPython.

In theory, Canopy can be provided in this way as another run version, but we want to tighten the UI with the least used options.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -