Is there anyway to install twain module in python 3

亡梦爱人 提交于 2019-12-11 01:46:12

问题


I want to install the Python TWAIN module in Python 3. But in the docs it says:

Python versions 2.1 through 2.5 are supported.

Can I convert it using 2to3?


回答1:


Use past module which provides an experimental translation package to help with importing and using old Python 2 modules in a Python 3 environment.

So install your package with pip

pip3 install twain --no-compile   # to ignore SyntaxErrors

And use next code to import twain in your python3 code :

from past import autotranslate
autotranslate(['twain'])

import twain


# use twain ....... 


来源:https://stackoverflow.com/questions/34747074/is-there-anyway-to-install-twain-module-in-python-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!