1
我試圖用Python和JavaScript交談串行。 背景是,我需要一個Android上的接口來控制連接到平板電腦或手機的USB端口的串行設備。我做了網頁設計,用HTML,CSS和JS構建界面對我來說很簡單。 也許有更好的方式,但我發現唯一的例子是這樣的(?): http://fabacademy.org/archives/2015/doc/WebSocketConsole.htmlPySerial Python錯誤:AttributeError:'Serial'對象沒有任何屬性'_port_handle'
所以,我沒有安裝:
Visual C++ 2008 SP1 Redistributable Package Eng (x86)
Visual C++ 2008 SP1 Redistributable Package Eng (x64)
Visual C++ Compiler for Python 2.7 v9.0.0.30729 Eng
Python x86 v2.7.11
而且在CMD:
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade virtualenv
python -m pip install --upgrade wheel
python -m pip install --upgrade pyserial
python -m pip install --upgrade tornado
python -m pip install --upgrade multiprocessing
問題以我得到的那個例子爲例:
AttributeError: 'Serial' object has no attribute '_port_handle'
因爲我從來沒有用Python做過多 - 我迷路了。