Moving from Scratch to Python

So going from visual programming like Scratch to a text-based language can intially seem a bit lame. Yep, that makes sense to me. We’ve just gone from something that lets us drag blocks into a window with spinning monkeys and bouncing balls, to…typing words, that makes a few words come up on the screen, or draws a boring star.

The other thing that made this change kind of suck, is that things don’t work nearly as easily as Scratch does, at first.

So some of the annoying things that have slowed us down include:

  • laptops having the wrong version of Python on them, so we had to change our code or the commands to run things
  • IDLE being confusing or not running
  • having to edit things with weird editors
  • AND WHAT ARE THESE CRAZY ERRORS!!!?!??? Scratch didn’t have these!!!

Our grand plan is that we have a heap of different activities running at one, and people can choose what they want to do. The only thing we need to remember with that plan is that we need to show parents and teachers that we’re making cool stuff, learning, and having fun. So keeping this in mind, we wouldn’t be going through all of this if Python wasn’t helping us make cool stuff and having even more fun…eventually.

It’s pretty easy to do fun stuff with Scratch because we move things and see if the collide.. and w00t we have a game! And even though we can use Scratch to do things like robots, and make lights go on, there are limitations. We have Stencyl, but more about that in a later post ;)

As for Python, even some teachers have been asking what it can do. We know it can do crazy things that seem a long way from our simple scripts, but here’s some uses that only require simple scripts:

  • read web pages and extract information we want, then do things with it
  • make a script that waits for something to happen, say if someone triggers a sensor or touches your computer, lock them out andrecord them with a camera and then email it to you
  • make robots do interesting things, like stream video to a website, balance on 2 wheels, detect faces, analyse writing from a photo and speak it, understand its surroundings and avoid or pick up objects
  • create chat bots that pretend to be human and interact with social media
  • automate repetitive tasks, such as renaming lots of files, or converting large amounts of audio files to another format, or sorting and converting videos based on a particular attribute such as date or name
  • decode information from radio signals, such as airplane coordinates, and plot them on google earth
  • extract geographical information from photos and see where someone has been at given times
  • this blog uses software written in Python to generate all the web pages
  • among some of the software built with Python are some great artificial intellingence tools that can be integrated into other projects

To sort out the details of trying out commands, editing, and running out Python, I put together an updated-from-the-other-day cheatsheet

A big advantage of learning to code in Python is that we don’t have to worry about a lot of complicated syntax (rules for formatting the code) or extra code to make it work. It runs on many more things than Scratch does, and can do much more complicated work and still have simple, readable code. And once we know a bit about Python, there’s a whole lot of extra modules available

Understanding a programming language means you can have an idea, but actually make it.