Fylke
Fylke

Reputation: 1836

Writing to the serial port in Vista from Python

How do I write to the serial port in Vista from Python? The termios package only seem to support posix.

Upvotes: 5

Views: 2723

Answers (2)

Fylke
Fylke

Reputation: 1836

Seems like it wasn't any harder than this using pyserial:

import serial

ser = serial.Serial(0)  # open first serial port with 9600,8,N,1
print ser.portstr       # check which port was really used
ser.write('hello')
ser.close()

Upvotes: 7

Toni Ruža
Toni Ruža

Reputation: 7512

pyserial does the trick, you'll need python extensions for windows for it to work in windows.

Upvotes: 9

Related Questions