Python

Thoughts, comments, links, code on Python, my favorite open-source scripting language. It’s a high-level scripting program that is so intuitive that you pretty much don’t need to write psuedo-code because it looks like psuedo-code.

Learning Python

I’m currently teaching a Programming for Beginners, and I thought my students might appreciate some resources for learning Python. Here they are in no particular order:

  • Hello World: Computer Programming for Kids and Other Beginners – one of my students showed me this book. I think this might be my new “textbook” for beginning programming. They have some good PyGame samples, and most chapters cover programming games. They even have a 3D chapter using VPython (Visual Python)
  • One Day of IDLE Toying – If you’ve never worked with IDLE before, you should really start here.
  • Instant Hacking – this is a very short, but jam-packed, introduction to both programming and Python.
  • Young Programmers Podcast – if you would rather learn through video podcasts, this is the place for you. This also contains PyGame tutorials. Note: some indicate Jython, which works with Java (not a bad combination, since it allows you to work with Java classes), but I’m guessing you need the Java SDK for this.
  • Learning to Program – this covers a large amount of Python, but I haven’t had much of a chance to explore it. A nice feature of this site is that it has two different versions: one for version 2 and one for version 3
  • A Byte of Python – If you already know how to install Python and get a new file created, I recommend you jump right to chapter 4 (the Basics) or beyond.
  • How to Think Like a Computer Scientist – this was the site that I initially learned Python with. It’s a bit high-end for younger learners, especially the writing, which almost reads like a college textbook

Downloads

  • Download Portable Python 2.6 – the advantage with Portable Python is that you can install it and run it off a flash drive AND comes with PyGame
  • Download Python 3.1.2 Windows Installer – just know that with Python version 3, print is a function print(“Hola, el Mundo!”), and there is no raw_input(), it’s just input() and it treats data as a string, so you’ll need to cast your number strings into floats or integers.