Author dhalbert
Recipients dhalbert, gvanrossum, serhiy.storchaka, terry.reedy
Date 2019-05-08.04:18:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557289135.83.0.754977437254.issue36807@roundup.psfhosted.org>
In-reply-to
Content
>Dan, slightly OT, but I am curious whether one can access USB ports (in a system-dependent manner) directly from python code via os.system and ctypes?

Do you mean from CircuitPython? The USB impplementation provides HID keyboard, mouse, and gamepad devices, CDC (serial), MIDI, and MSC (CIRCUITPY). We don't provide ctypes (though MicroPython does), but there are native modules that provide access to these devices. We will are planning to add user-defined USB descriptors.

Also, we provide some enhancements in a CircuitPython-specific module to peek for input on CDC, so you can know when to call `input()`, without using the usual OS-dependent Python tricks for this.

Right now REPL input/output is mixed with user input, as you mention, but we're considering adding a second serial CDC port so you'll be able to have a second serial channel and avoid colliding with the REPL.

I'd be happy to discuss this kind of stuff with you further, by email or whatever other mechanism you have in mind, like some appropriate python mailing list or our own chat servers, etc.
History
Date User Action Args
2019-05-08 04:18:55dhalbertsetrecipients: + dhalbert, gvanrossum, terry.reedy, serhiy.storchaka
2019-05-08 04:18:55dhalbertsetmessageid: <1557289135.83.0.754977437254.issue36807@roundup.psfhosted.org>
2019-05-08 04:18:55dhalbertlinkissue36807 messages
2019-05-08 04:18:55dhalbertcreate