How do I reload a module after changing it?

后端 未结 4 1836
太阳男子
太阳男子 2020-12-09 09:51

Python Console with Python 3.4.2

I defined a function in a module which runs correctly in Python Console in PyCharm Community Edition 4.5.4:
ReloadTest.py:

4条回答
  •  遥遥无期
    2020-12-09 10:23

    You can instruct Pycharm to automatically reload modules upon changing by adding the following lines to settings->Build,Excecution,Deployment->Console->Python Console in the Starting Script:

    %load_ext autoreload
    %autoreload 2
    

    This function comes from IPython as described here: Reloading submodules in IPython

提交回复
热议问题