PySerial [Error 5] Access is Denied

前端 未结 5 1961
不思量自难忘°
不思量自难忘° 2021-01-05 08:40

I am trying to write a program in Python that will loop to keep checking the serial port (COM4) and print out a message when the character \"1\" is read from the serial port

5条回答
  •  执笔经年
    2021-01-05 09:10

    For Python 2.6 use the zero-based COM port index. For Python 2.7.x you can use the full name "COM4". From my experience it's better to use the 2.7 version. Install Python 2.7.x and Setup Tools (aka Easy Install). Once you've got this, install pyserial module by typing easy_install -U pyserial (see pyserial installation doc).

    Remember to add python path to PATH environmental variable.

提交回复
热议问题