>>> from imp >>> imp.reload(module)
>>> from imp import reload >>> reload(module)
>>> from recommendation import critics Traceback (most recent call last): File "<pyshell#7>", line 1, in <module> from recommendation import critics ImportError: No module named 'recommendation'
>>> import sys >>> sys.path.append("C:\Python34\PCI_Code\chapter2")
>>> from recommendations import critics >>>
>>> from imp import reload >>> reload(recommendations) Traceback (most recent call last): File "<pyshell#86>", line 1, in <module> reload(recommendations) NameError: name 'recommendations' is not defined
>>> from imp import reload >>> import recommendations >>> reload(recommendations) <module 'recommendations' from 'C:\\Python34\\PCI_Code\\chapter2\\recommendations.py'> >>>
以上就是python中reload用法实例的详细内容,更多请关注Gxl网其它相关文章!
查看更多关于python中reload用法实例的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did84448