我已经按照以下步骤在Windows上安装了图像扫描仪模块。我已经连接到无线网络上的扫描仪。当我尝试此代码时:
from imagescanner import ImageScanner
iscanner = ImageScanner()
scanners = iscanner.list_scanners()
print(scanners[0])
出现错误消息:
C:Python3.4python.exe C:/Users/PB/PycharmProjects/ImageScanner/deneme.py
Traceback (most recent call last):
File "C:/Users/PB/PycharmProjects/ImageScanner/deneme.py", line 4, in <module>
from imagescanner import ImageScanner
File "C:Python3.4libsite-packagesimagescanner-0.9-py3.4.eggimagescanner__init__.py", line 2, in <module>
from imagescanner.core._imagescanner import ImageScanner
File "C:Python3.4libsite-packagesimagescanner-0.9-py3.4.eggimagescannercore_imagescanner.py", line 61
except Exception, exc:
^
SyntaxError: invalid syntax
Process finished with exit code 1
据我所知,imagescanner 与 Python 3 不兼容。
您可以尝试修复它。SyntaxError 引用了异常的旧语法(在较新版本中,"class, variable"变为"class as variable")。但我不确定你能找到什么其他问题。