【发布时间】:2014-11-24 10:30:01
【问题描述】:
以下是我的代码,
import shelve
sd = shelve.open("session.data")
当我在 IDLE 中尝试相同的代码时,我没有收到任何错误。 但是当使用此代码运行脚本时,我收到以下错误,
Traceback (most recent call last):
File "try.py", line 3, in <module>
sd = shelve.open("session.data")
AttributeError: 'module' object has no attribute 'open'
【问题讨论】:
-
您的目录中有
shelve.py吗? -
哦,是的。对不起,感谢您的回答。
标签: python windows attributeerror shelve