FakeFile

A tiny python library for faking out filesystem operations for tests.

July 2, 2014 路 1 min 路 Ohad Lutzky

Translationese

As part of my M.Sc. studies, I鈥檝e recently completed a small laboratory project in natural language processing. I鈥檝e learned quite a bit from it, and had a chance to use a few of my favorite technologies. The project was coded in Python, which is not my favorite programming language - Ruby is. However, since Python is more popular at my workplace, and seems to have a richer ecosystem around it (sometimes, at any rate), I鈥檝e grown to love it almost as much over the years....

March 24, 2013 路 4 min 路 Ohad Lutzky

Faster Languages

Due to an exercise in an AI course, I鈥檓 forced to confront an old nemesis - C++. Part of the reason is that the exercise contains a time-limited tournament, and the code needs to run very quickly. Another reason is, I guess, the fact that C++ serves as a sort of lowest common denominator in the course (which used, by the way, to be taught in LISP, along with the language)....

April 16, 2008 路 3 min 路 Ohad Lutzky

On Threading vs. Processing

Writing multi-threaded applications in Python is often a headache because of the Global Interpreter Lock - only one Python thread can run at any given moment, which makes multi-threading useful only in the case where all modules but one actually run C code. However, thanks to the impressive new Python Magazine, I鈥檝e stumbled across a package called processing, paraphrasing python鈥檚 built-in threading package. Essentially, the package provides an API identical to Python鈥檚 threading, but uses processes and pipes (or other mechanisms on non-posix operating systems) instead....

October 13, 2007 路 2 min 路 Ohad Lutzky

Exception handling, decorators, and python

Lately I鈥檝e been working on a project that has me using DBus a lot. After trying to figure out how to work DBus with C, and seeing how easy it is to do in Python, we figured we鈥檇 try to use embedded Python to do this. Fortunately, it鈥檚 very simple to use - especially thanks to this guide. It later turned out to be much easier to do in C, as described in Faster Languages....

September 16, 2007 路 2 min 路 Ohad Lutzky

IPython

The more I use Python, the nicer it becomes. I鈥檓 currently working on a project for a course, which involves somewhat heavy-duty database and algorithm work. Python is my language of choice for it - let鈥檚 hope it works out well. In the meantime, I鈥檝e found a really nice python shell called iPython (available in apt) - it adds a bunch of stuff to the python shell which I sorely missed from irb - autocompletion, auto-indentation, and - it seems - adds a whole lot more....

March 4, 2007 路 1 min 路 Ohad Lutzky

Really liking the whole Python thing

I鈥檝e converted my Antigibberish script1 (converts 鈥渂roken hebrew鈥 into proper hebrew, useful for sent-offline ICQ messages) to Python鈥 it鈥檚 quite a nice language, and the interpreter is FAST! I鈥檓 really torn between it and Ruby :( Used to have a copy of antigibberish.py, but it鈥檚 been lost in the mists of time. It used to do the equivalent of this: iconv -f utf-8 -t iso8859-1 | iconv -f iso8859-8 -t utf-8 聽鈫╋笌

February 25, 2007 路 1 min 路 Ohad Lutzky