Prevent Python from caching the imported modules

后端 未结 8 1702
误落风尘
误落风尘 2020-11-28 07:40

While developing a largeish project (split in several files and folders) in Python with IPython, I run into the trouble of cached imported modules.

The problem is th

8条回答
  •  悲&欢浪女
    2020-11-28 08:03

    Think twice for quitting and restarting in production

    The easy solution without quitting & restarting is by using the reload from imp

    import moduleA, moduleB
    from imp import reload
    reload (moduleB)
    

提交回复
热议问题