with open('com1', 'r') as f:

gert gert.cuykens at gmail.com
Thu Apr 2 13:01:02 EDT 2009


from subprocess import *

check_call(['mode', 'COM1:9600,N,8,1,P'],shell=True)
while True:
    with open('com1', 'r') as f:
        for line in f:
             print('line')

This works very well except for one thing. After a reboot I have to
launch 1 time any windows serial exe application no mater with one,
that just opens an closes the com port, before i can launch this
script. The script keeps on working even after closing and reopening
it, until i reboot the pc. Then again I have to launch one time a
serial.exe and close it again. The exe does not run anything in the
background it just does something in windows python does not do when
it reads from the com port after a fresh reboot.

And i really appreciate it if somebody knew what it was.



More information about the Python-list mailing list