+ -
当前位置:首页 → 问答吧 → python 不知为何输出None

python 不知为何输出None

时间:2011-07-19

来源:互联网

在python基础教程中看到
sys.path.expanduser()可以使用
但在我机器上用 提示异常。。。
bells@bells:~$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.expanduser('~/python')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'expanduser'
>>>
请问下 怎么回事??

作者: bellszhu   发布时间: 2011-07-19