rpi pico: How to detect that sys.stdout is connected
Posted: Mon Jul 12, 2021 5:23 pm
How can one detect if the usb serial is actually connected to the host pc?
I have tried uselect.poll and test for uselect.POLLHUP and uselect.POLLERR without success,poll(0) always returns [].
But if the pc goes to sleep, print() blocks. It unblocks by itself when the pc wakes up.
Thank you.
PS. I had posted this question in stackoverflow. If that is against the rules, please forgive me and cancel the post.
I have tried uselect.poll and test for uselect.POLLHUP and uselect.POLLERR without success,poll(0) always returns [].
But if the pc goes to sleep, print() blocks. It unblocks by itself when the pc wakes up.
Thank you.
PS. I had posted this question in stackoverflow. If that is against the rules, please forgive me and cancel the post.