问题
Is it possible to make UMR work with 'F9' (run selection)? I often use the run selection feature in spyder to call a specific function of a module under debugging from an external script (MATLAB workflow). Using an external script helps to provide the required function input (variable explorer,...).
However, I don't want to run the entire script from the beginning ('F5'), since it contains time consuming calls. Unfortunately, it seems like modified modules are only updated via UMR when running the entire script file. In contrast, when using run selection, a reload() is required each time the module is slightly changed.
A workaround is to find and comment out all time consuming calls and then run the entire script to check the module, what is quite annoying since this must be revoked afterwards.
Is there a better way?
回答1:
(Spyder developer here) To reload code of a module you're developing in the Editor, as soon as you save it and without using F5, you need to run these two commands before start working on an IPython console:
In [1]: %load_ext autoreload
In [2]: %autoreload 2
来源:https://stackoverflow.com/questions/44824562/spyder-ide-reload-code-with-run-selection-f9