The Python Programming Language For Physical Hacking

We see projects here all the time that blend computing with the real world. Some people are naturally stronger on the mechanical end of things, whereas some are better with electronics or coding. All three specialities can be needed depending on your project. If your weakness lies in making a computer do your bidding, I might suggest that the Python language is a good one to learn.

I’ve been going through Learn Python the Hard Way, which is offered for free online, or you can pay for it if you so choose. I’ve published my thoughts on lessons 1-10 and 11-20 so far. As a mechanical engineer with limited (but not totally nonexistent) programming skills, it’s been an excellent experience so far.

If you’re wondering if Python is a good language to learn if you’d like to participate in [HAD] style projects, why not check out the following projects featured here:

Have you seen my blog? Why do you think this does not constitute hacking?

BTW: in my forthcoming book I will blink 20 LEDs with 256 brightness levels @>20kHz. Althoug the Arduino runs at 16MHz and has not hardware support for this I manage to keep CPU utilization below 65% thus allowing to compute the output on the fly. Try yourself and then explain why blinking LEDs is not hacking.

I use python in my day job, but I’ve also used python to write code for the OWI EDGE USB robot arm – it only came with a rather rubbish windows CD, and using PyUSB I’ve got code that will work on Win, Lin and Mac. Once I’d found some data on the protocol the arm used for its USB stuff, it was an afternoons work to get it to move blocks. Having no sensors as it came, there was a lot of fiddly time based stuff – I am working on adding sensors to it…

When I have to learn a new programming language, I usually fire up my text-editor, my browser, and start programming with the help of google.

I’ve just started to learn Phyton two weeks ago (comming from PHP), and now I’ve already written a programm containing 1k+ lines of code.

I’ve found out that I haven’t got the patience to read long, boring books, so I just start to code (trial and error). In the first few days, it’s really a PITA to get used to the syntax, but after that it’s just a matter of memorizing all of these functions.

python is ok but if you really want a language to hack with use lisp. its basically is python with less syntax and more features. classes inheritance but also data is code, code is data. seriously if you want to actually hack stuff you need to use lisp or you may not live the next twenty seven and a half years. man you must hack with lisp. lisp lisp lisp lisp lisp. defun(gotcha (total) (if (eq total 0) (princ “shit”)(princ “man your lame”)))