Monthly Archives: January 2007

Vim: Spaces instead of tab characters.

Indentation is important in Python code. Period. (This is really a big, emphatic, bright period.)
Python programmers who move their code from machine to machine prefer to use “spaces as tab characters” over “normal tab characters” for indentation in their code. There is a good reason why they do that.
If you code in Vim, like I [...]

slackperm, version 0.2!

This announcement comes in way too late.
Earlier this month, I released version 0.2 of slackperm. slackperm is now almost complete. It can, now, also commit the changes required to fix the errant permissions on the filesystem. It has, however, not been thoroughly tested.

I hate what I hate. (Random Musings #20)

If there is something I have come to hate more than most of the things I hate, it is being friends with people who fall down quickly to grab your feet when they are in need, convince and assure you that if you need anything, you need only ask of them, and turn colours faster [...]

Python, and the reacquaintance.

Oh, yeah, this is a small Python script to grab comments from the source of a webpage.

from sgmllib import SGMLParser
class CommentParser(SGMLParser):
“Extract comments from webpage.”
def reset(self):
self.comments = []
SGMLParser.reset(self)

def handle_comment(self, text):
“”"Push comments into the comments list.”"”
self.comments.append(”%(text)s” % locals())

def display(self):
“”"Returned parsed comments as raw text.”"”
return “”.join(self.comments)

if __name__ == “__main__”:
import urllib
import sys

try:
host = sys.argv[1]
except IndexError:
host = ‘http://ayaz.pk/’

try:
w = [...]

Python script to grab (titles, links) from wordpress feeds.

Sometime last to last year I picked up Python. I studied it for a day, and feeling overwhelmed by my love for Perl, I ditched it the next day. I won’t tell you why (yeah, it’s a secret, unless someone comes along merrily who knows the secret and comments about it), but I picked up [...]