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:

Or just do a search of [HAD], and you’ll find many other projects for inspiration. If you’ve got a Python project to share, be sure to tell us about it in the comments!

Comments

  1. C.Fraser says:

    Great place to learn python, udacity.com

  2. 1one says:

    Blinking LEDs is not hacking

    • Why do you think blinking LEDs is not hacking? Have you seen my blog?

    • stuff for name says:

      No it isn’t, but writing a driver in a fast to develop scripting language is an awe inspiring one.

      • 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.

        Device drivers are mostly boring.

        Take this:
        PYTHON
        >>>e = lambda x: lambda f: f(x)
        >>>e(e(42))(e(lambda x: x))

  3. Madox says:

    I use Python a fair bit in physical projects :-

    http://www.madox.net/blog/2011/01/24/mecanum-wheel-rover-2/

    It is even handy to use for making of physical objects :-

    http://www.madox.net/blog/2011/10/11/image-to-svg-cutout-script/

  4. LordNothing says:

    ive always been a lua kind of guy when it comes to interpreted code. never hat to learn python yet. frankly the strict whitespace usage would drive me nuts.

  5. Cyril says:

    My favourite abbreviation of python is “pft”

  6. Danny Staple says:

    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…

  7. PB says:

    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.

  8. 0.zer0 says:

    I’ve been learning Python in spare moments reading “Byte of Python” by Swaroop C H.

    http://www.swaroopch.org/notes/Python

  9. treacle says:

    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”)))

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,557 other followers