As shown in a previous blog post working with pyFirmata is similar to writing sketches in the Arduino software. It’s Python but the concepts are the same.
There is not much to say about the code because it’s contains almost the same elements as the previous example.
Download the two files from here. I hope that upstream will proceed the pull request after that this will be available in the official pyFirmata package.