我将使用 Windows 版本的 PyPy阅读 Segaran 的Programming Collective Intelligence 。
作者正在逐步构建这个例子。首先加载字典:
from recommendations import critics
然后通过添加一个新函数来修改 Recommendations.py。然后读者应该重新加载模块:
reload(recommendations)
我没有成功重新加载,而是收到此错误:
>>>> reload(recommendations)
Traceback (most recent call last):
File "<console>", line 1, in <module>
NameError: global name 'recommendations' is not defined
难道我做错了什么?