如何让Springpython容器获取对代码的更改

如何让Springpython容器获取对代码的更改,python,ioc-container,Python,Ioc Container,我使用springpython的方式如下: from springpython.context import ApplicationContext from springpython.config import XMLConfig appContext=ApplicationContext(XMLConfig("service.xml")) service = appContext.get_object("service") 如果我从解释器运行此命令,如何让容器重新加载对service.

我使用springpython的方式如下:

from springpython.context import ApplicationContext
from springpython.config import XMLConfig   
appContext=ApplicationContext(XMLConfig("service.xml"))
service = appContext.get_object("service")
如果我从解释器运行此命令,如何让容器重新加载对service.py文件的更新?因为我没有在代码中显式地启动容器,所以我不确定如何重新启动。 我是否需要停止并启动python会话?
如何建议在开发过程中进行更改

springpython没有任何内置的文件监视功能,因此它本身无法检测更改。您需要编写一些内容来监视service.xml,可能会散列它的内容或监视mtime,以及它何时更改,然后重新构建appContext。

重建appContext的步骤是什么?在会话期间,我可以将其设置为null并重新运行这些命令。appContext=ApplicationContext(XMLConfig(“service.xml”))service=appContext.get_对象(“service”)