Wednesday, July 31, 2013

Site em portugues


Algo novo hoje:

em portugues!


O site juntamente com a documentação foi traduzido. Tudo graças aos esforços de Yuri Teixeira.


Existe tambem um grupo googlegroups em portugues:!forum/brython-pt


Thursday, July 25, 2013

Of videogames, arduinos and 10 year olds


That's Mr. Visual Python to you (the visual module, that is). At the last PYPTUG meeting, Aaron Titus gave a talk on Visual Python. I think it was about writing (well, mostly playing) videogames under the veneer of learning physics. :)

All joking aside, it was a really great talk. It was also the first time we were using Google+ Hangout to help some members to check the presentation. And particularly a father and daughter who would not have been able to make it in time for the meeting. More on that further down.

Pyfirmata lightning talk

So I gave a lightning talk on Pyfirmata and Arduinos. It was part of my talk at PyCarolinas last year but didn't have time to go into the code detail (plus another talk earlier that day had covered really extensively serial communications). And it's really about serial communications (be it USB, bluetooth or plain old RS-232/rs-422) and microcontrollers (it's not just for the 'duinos). I ran the python code on a Raspberry Pi, but you could use pretty much any computer that can run python.

The protocol is firmata:

The python module is Pyfirmata:

To install, you can use :
pip install pyfirmata
easy_install pyfirmata

Since both pip and easy_install automatically install dependencies, that's all there is on the host computer side.

Or from source using, but you will have to install the serial module.

You dont have to handle the serial stuff yourself, just point to the right /dev/ (serial, usb or bluetooth), start an interator and start using read(). Pyfirmata handles the serial itself and sending/receiving the sysex bytes (Firmata is a MIDI inspired protocol).

To install the firmata firmware on the Arduino, start the IDE and go to:

The bitbucket repository for my talk (presentation and simple example that reads values from analog port 0 on the arduino) is at:


The young coder

"After watching the stream, this morning I left my 10 year old building spheres and boxes in VIdle.  She'd never done programming of any kind before last night." -- Ryan

I think this speaks volume about Python and the visual module. And that's what PYPTUG is all about. Now we just got to get her a Raspberry Pi.


Sunday, July 21, 2013

Trip to the bookstore


Part of a good local technical community is having local technical schools, hackerspaces, computer stores, electronics parts distributors, libraries and book stores with good technical books, and of course user groups.

For PYPTUG community news, I try to always make a note of Python related things wherever I go so I can share it with fellow community members in the Piedmont Triad.

This is suspiciously easy

Python is easy to get into. In fact, here's something on the back of a book I saw at the local Barnes And Nobles (Hanes Mall, Winston Salem, NC):

Hello! Python

Couldn't help but to share that with my wife. It is on the back of the book Hello! Python by Anthony Briggs.

And that too

Using the Raspberry Pi in various projects is also quite easy, and having tutorials or a guide makes it that much easier. Of course I have plenty of tutorials on my blog, but if you are looking for a Raspberry Pi book you can hold in your hands, there are a few available now, and if you are in the Winston Salem area, you can pick these up without having to wait for the postman:

Raspberry Pi User Guide by Eben Upton

Getting Started with Raspberry Pi

Programming the Raspberry Pi

Nice to see this on the bookshelves.

Adding Arduino to the mix

And speaking of Raspberry Pi, tomorrow I'll be doing a lightning talk on something I had talked about back in 2012 at PyCarolinas. I was going to get into more details at PyOhio, but as you've no doubt noticed, I'm not on the speaker list, so instead I'm covering this locally at PYPTUG.

So what is it? A super easy way to interface with microcontrollers, including the Arduino, using Python. Did I say super easy? Suspiciously easy :)


Thursday, July 18, 2013

Pidora and Python

Hands On: Raspbian alternative on Raspberry Pi Part Deux

Last month, I looked at FreeBSD and Arch Linux and demoed these in a hands on session. This month, one of the Pi I'll have for the hands on this coming monday at WFU will be running Pidora.

If you are used to Raspbian for your Python coding, you'll find that there are a few differences, such as using yum instead of apt-get. Development packages end in -devel instead of -dev. All of that is quite normal since pidora is really Fedora and Raspbian is debian.

What I've found though is that if you are not willing to build quite a few packages yourself, it is still a little early to adopt pidora. I've not been able to get a satisfactory (ie, full library support) version of pygame going (no package available in the pidora repository at this time). No mpeg, no framebuffer support etc.

On the plus side, it boots very quickly (faster than arch or raspbian) and the shutdown is also extremely fast. I suspect that within a few months, the repository will be a bit more complete and will make python development easier. I'll revisit the OS later this year.