# coding:utf-8
import time,serial
ser = serial.Serial('COM3', 57600, timeout=10,parity=serial.PARITY_EVEN, rtscts=1)
i = 0
now = time.time()
print(ser.inWaiting())
# while ser.inWaiting() > 0:
while 1:
s = ser.readline()
i +=1
# nows = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
nows = time.time()
if nows > now + 60:
break
# data += ser.read(10)
# if data != '':
# print (data)
print(s)
print((i)/3)