async-serial
async-serial copied to clipboard
modify code to use pty virtual serial devices
Thanks for the pull request! I'm not familiar with the pty module, so I'm hesitant to accept this right now. I would also need to modify the other examples and update the accompanying blog post to keep everything in sync. If you wanted to make a new example using the pty module and explain what's going on, I would consider accepting that.
Unrelated to the PR, I've also discovered that you can do async serial much easier using the trio library. It provides an async file wrapper (read this), which you can use to wrap the serial.Serial class as it exposes the same API as a file object. Using that method the only difference between the sync and async code is a few awaits here and there.