|
|
PythonRelearning how to rideI never stopped programming, not quite. It's just my code became hackier and hackier. For a non-programmer, think of it as writing a novel first by crafting letters into words into sentences but then, rushed for time, you start clipping words from other sources, ransom note style, and pasting them, collage-style, into a book. And then one day, you simply rip and re-order whole pages from Dickens, Stephen King and some cranky luddite journalist. I would posit then that, yes, it is still possible to make great literature (I'm a huge fan of Barthelme, who consistently pushed the limits of narrative), but it's much more likely that you're cranking out something barely serviceable, and that such cranking is an ultimate disservice to your own ability to craft. I started programming long ago. Like many others of my rough generation, I started with BASIC, which was included on Windows 3.1. It must've been sometime in the early to mid-90s. I remember distinctly hacking away at a game where you controlled a giant ape who threw bananas at another giant ape, and modifying the code to make the apes throw other objects, though for the life of me I can't remember what I so gleefully made them throw. Perhaps that's for the best. After that, some rough scripting until Alice 3D, which introduced me to the wonderful world of Python. Alice was the brain child of Randy Pausch, who became famous when he faced death and gave his Last Lecture. I still haven't seen that lecture, to my embarrassment, but the gift Randy and Carnegie Mellon gave the world in Alice I cherish. It was an easy, non-intimidating introduction to programming that let a middle school kid self-tech himself programming in a fun way. Learn while loops by blowing up a car in 3D, for example. It's a crime that Alice 3D isn't a teaching tool in every middle school in America, and if it were our economy would be in much better shape. And so to Python I've returned, relearning Python the hard way via Zed A. Shaw's wonderful book. Being self-taught, my education was spotty but his 210 guide has gotten me up and running again at a good pace without any stumps, while patching in the numerous holes my self-education had left.
A nice Django tutorial/development environment for Windows users
The site also has a great tutorial up on using the packages and making a (very very very basic) EveryBlock clone. If you're looking to jump into Django, no programming experience necessary, give Instant Django a try.
PoBoy Twitter Tracker 0.1: A small Python script to collect follower counts
The following Python script simply reads through a text file to find out the Twitter accounts you want to check, and then spits back those account names and how many followers each of those accounts has:
#pwd='***' listofnames = file('twitterusers.txt').readlines() csvfile=open('twittercounts.csv','ab') for name in listofnames: csvfile.close() Note that this script requires the Python Twitter wrapper, although it just barely taps into that wrapper's functionality (Note that the script doesn't even require a username or password to work!). To run it, after installing the Python Twitter wrapper, put the script and a plain text file with the usernames you want to scan (one per line, no commas) into the same directory. Note that right now, there is no error checking, so if one of the usernames is mistyped, is deleted or changed, the script will probably crash. I plan on fixing this in the next release. It's fairly trivial to expand the functionality to include the number of people that user is following, the latest updates, etc., and for that I highly recommend Amy Iris' tutorial on Twitter tracking in Python; I simply needed something a little more basic and that output into an Excel-compatible file.
|