January 19, 2006 Archives

but if you break the elbow rule, you die

posted by catherine / January 19, 2006 / 3 comments /

gawd.damn. you can make $10,000 in the tournament of beer pong. why the hell wasn't this around when i was still in college?

things i should have known about

posted by tom / January 19, 2006 / 5 comments /

  1. Amazon's Games You Should Play.

  2. The Perry Bible Fellowship. I really, really feel like I should have known about it. I mean, jesus, look at this! Look!

go, journalism!

posted by catherine / January 19, 2006 / 14 comments /

one reason i love my very local chicago news station that i watch in the mornings: as i was getting out of the shower around 7:15, this is what i hear coming from the television:

"stacey, can you run the clip of the monkeys riding horseback?"

cause otherwise i'll lose the link

posted by tom / January 19, 2006 / leave a comment /

The Penny Arcade guys gave a talk at MIT, if anyone's interested. Transcript here.

Weird — for the first time, I actually wish something was in an audio format instead of having been transcribed to text. Can vlogging be far behind?

>>>>>

posted by tom / January 19, 2006 / 2 comments /

I've been meaning to link to it forever, so here it finally is: PayItForwardForward. Conceived of and executed by a duo with the two talents necessary for comedy: a love of abstract, high-concept nonsense; and a distinct lack of concern over breaking their poor mothers' hearts.

yes, i still care about *some* intellectual property

posted by tom / January 19, 2006 / 4 comments /

It turns out that my lack of style is actually just responsible consumerism: Urban Outfitters is run by a bunch of goddamn thieves.

via preshrunk

installing and testing python

posted by tom / January 19, 2006 / 9 comments /

This should be pretty easy.

Windows
You have two options. The basic distribution of Python (2.4.2) is available here. However, there's also a free IDE (integrated development environment) available here. The latter option (ActivePython) is probably easier to work with, and doubtless has a lot of cool features. Let's go with that, why don't we.

Mac
OS X 10.2 and higher comes with Python pre-installed. You don't have to do anything — but I'd recommend that you go here, download the installer, and run it. For one thing, this will update your version of Python. For another, it will provide you with an IDE of your own (PythonIDE). More importantly, it'll provide a package manager, which will be important later.

Linux/Other
You guys probably know how to fend for yourselves. Source tarballs can be found here.

Testing It
Let's put together a Python program. I promised interesting applications, but it'd be a shame to skip past Hello World -- it's a rite of passage. Open up ActivePython or the PythonIDE and create a new file (File|New). Enter the following:

print "hello world"

It's hardly worth explaining, but I may as well: this single line calls the print function and passes it a string literal with the contents hello world. Don't worry about what a function is or what a string is or what a literal is (if you do know these things, feel free to feel smug about that fact). Just know that saying print "something" spits 'something' out to the screen, and that the quotation marks in the program aren't part of the output — in this case, they let Python know that it should treat the text hello world differently than it treats the text print.

Once you've got that entered (raise your hand if you're still working), save the file somewhere, then hit the "Run All" button in PythonIDE (Mac) or the "Check"/Little Running Guy button in ActivePython (Windows). ActivePython will pop up a "Run Script" box — just hit return.

The program should spit out the expected string in an output window (PythonIDE will create a new window; ActivePython sends output to the "Interactive Window" that should have opened when you started the program).

Astounding, isn't it? Well, don't worry, we'll be doing real programming soon. For now, just make sure that you understand how to create, load and save Python files — it's all done in exactly the same way as you'd manipulate documents in MS Word.

Also worth noting: these files are simply text files (usually with names ending in .py; that's just the convention). You can edit them in Notepad or TextEdit if you'd like, and run them from the command line by typing "python nameofprogram.py" (assuming you're in the same directory as the file, and the Python executable has been correctly placed in your path by the ActivePython or MacPython installer).

That's it for now. Next up, the meat of any programming language: variables, control structures and functions (not necessarily in that order). By the end of that lesson, you'll be ready to create some of the world's crappiest videogames. Let me know in comments if you had trouble with the installation or with Hello World.

Google Analytics