Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试使用 ImageInfo 和 Jython 从硬盘上的图像中获取信息。
我已经很好地导入了模块,但不断收到此错误:
TypeError: setInput(): expected 2 args; got 1
这是我尝试使用的代码:
filename = "C:\\image.jpg" img = ImageInfo.setInput(filename)
谁能指出我做错了什么。
干杯
伊夫
Jython 抱怨的缺失参数是 ImageInfo 对象本身,它还不存在。您必须先构建它。所以:
filename = "C:\\image.jpg" ii = ImageInfo() img = ii.setInput(filename)
或者
filename = "C:\\image.jpg" img = ImageInfo().setInput(filename)
也可以工作。