IPython autoreload changes in subdirectory

后端 未结 3 2004
暗喜
暗喜 2021-01-11 11:26

I launch IPython from the main folder /project. Now if I make changes in the file /project/tests/some_module.py, the changes fail to be autoreloade

3条回答
  •  半阙折子戏
    2021-01-11 12:01

    Try changing your file use_some_module.py to:

    import some_module
    
    some_module.hello_world()
    

    Reload with from import usually does not work.

    This works for me:

    %autoreload 1
    %aimport use_some_module
    %aimport some_module
    

提交回复
热议问题