发布时间:2019-07-15 10:45:51编辑:auto阅读(1908)
[seemmo@RegionServer1 duwen]$ python
Python 2.6.6 (r266:84292, Nov 22 2013, 12:16:22)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import Student
s = Student()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callablefrom Student import *
s = Student()
原因:
import module 和 from module import,区别是前者所有导入的东西使用时需加上模块名的限定,而后者不要。
可以试试:
[seemmo@RegionServer1 duwen]$ python
Python 2.6.6 (r266:84292, Nov 22 2013, 12:16:22)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import Student
s = Student()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callables = Student.Student()
上一篇: python 文件内容对比操作
下一篇: python abc模块
48922
48033
38789
35919
30340
27118
26124
20957
20778
19137
648°
728°
699°
693°
669°
633°
735°
816°
925°
1133°