I'm trying write a program to read from the serial port (barcode reader
attached) and dump to the console, so that my application program can
receive the data.
OS: Red Hat Linux 6
Python: 1.5.2
Program listing:
p = open('/dev/ttyS0', 'r')
t = open('/dev/tty0', 'w')
while 1:
x = p.readline()
print x # yes, I could read from /dev/ttyS0
t.write(x) # but this has no effect on console
Hope that someone could help.
Regards,
Thomas.
attached) and dump to the console, so that my application program can
receive the data.
OS: Red Hat Linux 6
Python: 1.5.2
Program listing:
p = open('/dev/ttyS0', 'r')
t = open('/dev/tty0', 'w')
while 1:
x = p.readline()
print x # yes, I could read from /dev/ttyS0
t.write(x) # but this has no effect on console
Hope that someone could help.
Regards,
Thomas.