Tag Archive: Python

How to write a DSL (in Python with Lark)

The first time I used Logo, it felt like magic. I could type a short sequence of simple commands, and draw beautifully complex shapes on the screen. In this tutorial, I will show you how to parse and interpret a Logo-like language in just 70... View Article

9 Comments

Baker – Expose Python to the Shell

It's been a long time since my last post, and it would be appropriate that I post about whatever it is that I've been working on. But I won't. I'm writing this post only to tell you about an interesting new python library I stumbled... View Article

1 Comment

PySnippets – improving code reuse

For a long time now, I've been hindered by the issue of utilities, or snippets. These are convenience functions and classes that are too small or too incomplete to justify a library, yet are useful enough to be used. I've posted a few on my... View Article

5 Comments

FileDict – bug-fixes and updates

In my previous post I introduced FileDict. I did my best to get it right the first time, but as we all know, this is impossible for any non-trivial piece of code. I want to thank everyone for their comments and remarks. It's been very... View Article

6 Comments

Pickling Python Expressions

My last post introduced the concept of X, a class which "absorbs" operations and behaves like a function. As many people pointed out, this was merely a syntactic alternative to lambda. You may like it, you may not. Now, after a rewrite, X can now... View Article

3 Comments

Fun While Avoiding Lambda (Python)

Readers, meet X. X is a class I wrote in Python as an alternative to using lambda. It has two main features: It acts as an identity function ( so X(3) == 3, etc. ) When performing operations on it, it returns a new class... View Article

13 Comments

Namespaces in Python – Revisited

Taking a short break from my artwork craze (but I promise more is to come), I reviewed some of the new features and changes in Python, brought by versions 2.6 and 3.0. There are many interesting features, but a very specific one caught my eye:... View Article

Reply