今天用python调用ice接口,遇到如下提示 ImportError: No module named Ice 解决方案是 set PYTHONPATH=C:\Program Files\ZeroC\Ice-3.4.1\python 然后又提示 import IcePy ImportError: DLL load failed: The specified module could not be found. 在网上看到别人是如下配置即可 C:\> set PATH=C:\Python26;C
首先,我们必须明确的一点是:python里无接口类型,定义接口只是一个人为规定,在编程过程自我约束 python的类是可以写任意个方法的 定义一个接口对继承类进行约束,接口里有什么方法,继承类就必须有什么方法,接口中不能任何功能代码 class Interface: def f1(self): ''' to do something :return: ''' class Something(Interface): def f1(self): print('to do something...')