how to “reimport” module to python then code be changed after import

前端 未结 4 710
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-02 12:37

I have a foo.py

def foo():
    print \"test\"

In IPython I use:

In [6]:  import foo
In [7]:  foo.foo()
test
         


        
4条回答
  •  [愿得一人]
    2020-12-02 13:25

    If you want this to happen automatically, there is the autoreload module that comes with iPython.

提交回复
热议问题