The Raspberry Pi Foundation has a GitHub page: https://github.com/raspberrypi/
Arduino devices are fully programmable microcontrollers. Check out the Adafruit Gemma and Gemma M0 that are specifically designed for wearable projects.
When you are running under IDLE the standard output isn't connected to a terminal. That's why you received the "inappropriate ioctl" error.