Archive for the 'Python' Category

YouTube runs on Python

Thursday, August 23rd, 2007

I love Python, I really do. It has clear syntax, a nice library support and I feel very productive using it.
But Python is an interpreted language and it’s slow. You don’t feel it until you do something stupid like going through all the pixels in a bitmap and converting them into gray scale. I tried [...]

Tracking down rogue print statements

Wednesday, February 7th, 2007

I’ve spend the last hour hunting for a rogue print somewhere in my code. I almost never use a debugger these days, relying almost exclusively on debug prints. Python makes it easy and Scite makes that even easier. That habit has just bit me in the ass. Like I said, I spend the last hour [...]

My wxPython code

Thursday, January 25th, 2007

It’s been a year now since I’ve started using Python and wxPython and it has been a wonderful experience. What I didn’t realize until now was how much useful code I’ve written during this time, code that could be useful to others as well.
I’ve decided to put up a page here, with all the modules, [...]

Extracting bookmark icons (favicons) from Firefox

Friday, January 5th, 2007

Favicons are those little icons sites have that end up in your bookmark list if you add the site there. I was wondering where were all these icons stored when I ran across this post that explains that Firefox holds those icons as base64-encoded strings inside the bookmarks.html file.
I wanted to get access to all [...]

Useful regular expressions

Sunday, November 19th, 2006

Everybody seems to have his own version of regular expressions for checking the validity of emails and URLs. I’ve combined serveral versions I found on the net to create my own.
Here’s the regular expression for checking the validity of email addresses:
^[a-zA-Z][w.-]*[a-zA-Z0-9]@[a-zA-Z0-9][w.-]*[a-zA-Z0-9].[a-zA-Z][a-zA-Z.]*[a-zA-Z]$
And here’s the regular expression for checking the validity of URLs:
^(http|https)://[a-z0-9]+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}(([0-9]{1,5})?/?.*)$
These regular expressions should work [...]

wxPython-IL

Monday, May 29th, 2006

There was a meeting of the Python-IL (Israel) smallish community tonight where I talked a bit about wxPython.
I went there in a firm intent to write some code and show some neat cross-platform tricks that are possible with the framework, but instead spent quite a lot of time looking a the blue screen of death [...]