How can I fix “[Error 6] The handle is invalid.” with PySerial

前端 未结 5 2021
一个人的身影
一个人的身影 2020-12-11 04:25

I\'m trying to connect to my phone from my Windows 7 PC using PySerial with the following code:

import wmi
import serial

c = wmi.WMI()
modem = c.query(\"SEL         


        
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-11 04:55

    I observed this problem with Python 2.7 win7 x64, and PySerial 2.5 installed automatically from easy_install.exe

    The problem is not there with PySerial 2.4, so if your code is compatible with 2.4, just use that one instead and the problem is solved. Notice that you have to use pywin32 also, and chose the version that correspond to your python (e.g. pywin32-216.win-amd64-py2.7.exe).

    See also https://sourceforge.net/tracker/?func=detail&aid=2921959&group_id=46487&atid=446302%5D2921959

提交回复
热议问题