I spent most of my high school years living on Guam trying to stay alive long enough to leave and start a new life. It wasn't a good time for me, and about the only good thing that came out of it w...

seen from Spain

seen from Brazil

seen from United States
seen from United States
seen from China
seen from Malaysia

seen from Germany
seen from China
seen from Germany
seen from China
seen from United States
seen from China

seen from Japan
seen from China

seen from Singapore
seen from United Kingdom
seen from Türkiye

seen from Russia
seen from United States

seen from Japan
I spent most of my high school years living on Guam trying to stay alive long enough to leave and start a new life. It wasn't a good time for me, and about the only good thing that came out of it w...
When using the terminal can you use it on a Mac?
Press ⌘ and spacebar then type “ter” and it’ll be right there in spotlight :)
Then give this tutorial a whirl, and you’ll be an expert in no time! —
The Command Line Crash Course
junglegame - A simple text-only game - Python 2.7
New exercise (45) in Zed Shaw’s free online book Learn Python the Hard Way: code your own text game from scratch.
This time I'm using GitHub from the start. Made my first commit just a few minutes ago. The game skeleton is complete and can be run, but not much happens yet.
Made my own game engine. It's similar to Zed's in ex. 43 but NOT the same. I'm happy about that.
The last of my Python PPTs for journalism students:
Learning Python - Week 4 from Mindy McAdams
This PowerPoint is a review of Zed Shaw’s exercises 27 - 34 in his excellent (HIGHLY recommended) FREE online book Learn Python the Hard Way.
See the course schedule for my journalism code course.
Quiz your (beginner) knowledge of Python
So I'm wrapping up a four-week Python module for journalism students, and each week I gave them a "self quiz" so they could see for themselves whether they really understood what they had studied in Zed Shaw’s Learn Python the Hard Way. Here they are:
Quiz 1 - exercises 0–12
Quiz 2 - exercises 13–19
Quiz 3 - exercises 20–26
Quiz 4 - exercises 27–34
Feel free to share.
pythongame - A simple text-only game written in Python
Zed's exercise 43 in Learn Python the Hard Way really kicked my butt. I wish I had kept track of how many hours I spent on this. I know it was more than 20. But it was worth it.
My game is not only complete, but it runs without errors. I have tried every way I can think of to break it, and it just runs. I'm proud of my bomb timer that announces a countdown until the spaceship blows up.
I guess all those weeks of playing Zork back in the 1980s were worth something after all.
Light dawns: Object-oriented programming
I've looked at code, I've read explanations, I've been doing both on and off for years now, but the usefulness -- the purpose -- of object-oriented programming techniques just never sank in.
Today is the day when I have, at last, understood. Ah.
I think I had enough programming knowledge (basics, foundation) to cross this gap long before today. It was a matter of application.
What I did not do before now was read, and write out code, and read, and write out code, and repeat, and repeat. It has taken about four days, an hour or two each day. Before, it just seemed like so much extra work, extra planning, extra thinking, that was not necessary for the short programs I have written. And this is still true. It would be perfectly okay for many small programs to be written without objects, without classes. They will run, they will work, they will not have conflicts.
Enter complexity. When a program is complex, when it must be longer than a few dozen lines -- and if multiple people will all be writing code for it -- then the brilliance of objects makes perfect sense. Because it's not about making wheels for a car, or Person and Employee, or all those things that are used as examples in explanations of object-oriented programming and how it works. No. It is not about objects. It is about bundling. It is about re-usability. Extending. It is about preventing conflicts that arise when the same word might be used to mean two entirely different things.
Here is what finally made it clear for me:
First, Zed Shaw's Learn Python the Hard Way, exercises 40 - 43. But not only those. Also what he asks you to do. I take Zed literally. When he tells me to go out on the Web and look stuff up, I do it. I read, I come back, I go out again. I take notes. I run code. I rewrite my notes.
Second, Python for Kids, by Jason R. Briggs, chapters 4 and 8. Chapter 4 is about turtle, a Python module that is often used to introduce children to programming concepts. Chapter 8 is about classes and objects, and partway through the chapter, when it's talking about two giraffes, I realized the giraffes could be two turtles -- which would be objects of the class Pen -- and everything fell into place like pieces of a Tetris puzzle when you're winning.
I had bought Briggs's book to find out whether anything in it might be useful for teaching college journalism students Python. I had skimmed parts of it before. I ran all the suggested code in the turtle chapter because I had never used the turtle module before. But I had put the book aside a few months ago.
Then I was diligently working through Zed's exercise 42, and I'm thinking: Classes, Attributes. This is like CSS. This is like jQuery. I see the structure, it's starting to seem familiar ... And then I remembered Briggs's book. I went back to his chapter 8 and read.
And there it was.
Don't give up. I think this is the greatest lesson taught by learning to program. We are rewarded again and again for our hard work, sticking to it, trying and failing and trying again. We might become stuck for a time, but we can figure out a way to become unstuck if we only continue trying.
Continue learning Python!
The exercises get tougher starting with No. 13 -- but you can do it!
Learning Python - Week 2 from Mindy McAdams
This PowerPoint is a review of Zed Shaw’s exercises 13 - 19 in his excellent (HIGHLY recommended) FREE online book Learn Python the Hard Way.
I made this PPT for my journalism students. See their course schedule.