Re: Serial communication problem
Cameron Simpson <[email protected]>
| Newsgroups | gmane.comp.python.tutor |
|---|---|
| Message-ID | <ZXkr/[email protected]> |
On 13Dec2023 07:20, Phil <[email protected]> wrote: >On 13/12/23 04:46, Alan Gauld via Tutor wrote: >Thank you again Alan, >>I also don't much like the fact that you do two reads inside >>the while True loop. > >This was the cause of the problem. The read function is non blocking >which explains why I could only read the first byte before things went >awry. The cure was to make the second read blocking and I felt like a >real dill for not realising that sooner. Is there any reason for any of the reads to be nonblocking? Personally I find blocking reads easier to reason about. Cheers, Cameron Simpson <[email protected]> _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor