发布时间:2019-07-15 10:45:51编辑:auto阅读(1922)
[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模块
49072
48210
38946
36073
30488
27278
26285
21106
20952
19294
159°
258°
176°
828°
901°
881°
893°
848°
811°
969°