Skip to main content


Showing posts from October, 2012

Python3 Websocket Server

This is a follow up post combing pure Python Bluetooth sockets with pure Python websockets. Pure Python meaning no imports outside of the standard library and not using ctypes.

I decided my i-Racer car needed to have a much better user interface than my Python3 API. I mean when I first got it, typing car.forwards() was enough to impress me but no longer. For a while now I've been wanting to invest some of my time getting better at this web stuff. One of the suggestions I got prior to my Kiwi PyCon talk was to use websockets, problem was I didn't know much javascript yet alone websockets!

I started by looking at the Python libraries that implement websockets, tornado has one but I didn't want a whole web framework. The largest library is mod-pywebsocket. Unfortunately their API doesn't appear to easily lend itself to extension, and it is only Python2 which wouldn't play nicely with my Python3 bluetooth socket connection to the car. Their example applications have pr…