python的abc
作者: 2hei 发表于2009年5月18日 22:58 版权声明: 可以转载, 转载时务必以超链形式标明文章原始出处和作者信息及版权声明
http://www.2hei.net/mt/2009/05/python-module-abc.html
pyhon中很简单的模块调用
#!/usr/bin/python
# Filename: abc.py
def mymo():
print 'hello world!'
#!/usr/bin/python
# Filename: ehcoabc.py
import abc
abc.mymo()
执行结果如下:
AttributeError: 'module' object has no attribute 'mymo'
原因是abc在python中比较特殊,跟已有的module模块冲突,换一下名字就可以了。
#!/usr/bin/python
# Filename: abc.py
def mymo():
print 'hello world!'
#!/usr/bin/python
# Filename: ehcoabc.py
import abc
abc.mymo()
执行结果如下:
AttributeError: 'module' object has no attribute 'mymo'
原因是abc在python中比较特殊,跟已有的module模块冲突,换一下名字就可以了。





发表一个评论