python中模块没有属性_python – 模块对象没有属性’Screen’

Adam Bernier’s answer可能是正确的.看起来你有一个名为turtle.py的文件,Python在你的Python安装附带之前就已经开始了.

要追查这些问题:

% python

Python 2.7.1 (r271:86832, Jan 29 2011, 13:30:16)

[GCC 4.2.1 (Apple Inc. build 5664)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import sys

>>> sys.path

[...] # Your ${PYTHONPATH}

>>> import turtle

>>> turtle.__file__

'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/turtle.pyc' # Should be under your Python installation.

>>>

如果你看到这样的话:

>>> import turtle

>>> turtle.__file__

'turtle.py'

然后,您将要在当前工作目录中移动turtle.py(以及任何相应的turtle.pyc或turtle.pyo文件).

根据下面的评论,您可以通过调用help()来查找有关模块的大量信息,包括其路径名和内容.例如:

>>> import turtle

>>> help(turtle)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值