psSerial: how to write a single byte value to the serial port?

SoftwareTester mr_ravi_patil at yahoo.com
Wed Nov 17 03:57:23 EST 2004


http://pyserial.sourceforge.net/ 
example shows how to write string to serial port.


#Open port 0 at "9600,8,N,1", no timeout

>>> import serial
>>> ser = serial.Serial(0) #open first serial 
>>> ser.write("hello") #write a string
>>> ser.close() #close port

how do i write a single byte value to the serial port?



More information about the Python-list mailing list