Electricmonk

Ferry Boender

Programmer, DevOpper, Open Source enthusiast.

Blog

Category: python

Why Python Rocks III: Parameter expansion

Okay. So what’s cool about Python? I can’t count the number of times I’ve had to show skeptics why Python is cool, what Python can do that their favorite language can’t do. So I’m writing a bunch of articles showing off Python’s Awesomeness. All articles in this series: Why Python Rocks I: Inline documentation Why […]

Python destructor and garbage collection notes

I hardly ever use destructors in Python objects. I guess Python’s dynamic nature often negates the need for destructors. Today though, I needed to write some data to disk when an object was destroyed, or more accurately, when the program exited. So I defined a destructor in the main controller object using the __del__ magic […]

pyBrainfuck v0.2 released

I just released v0.2 of pyBrainfuck. PyBrainfuck is a speed-optimized Brainfuck interpreter written in Python. Some other Python interpreters already exists for Brainfuck, but they are either obfuscated or awfully slow. PyBrainfuck has been optimized for speed by doing various preprocessing on the code such as pre-caching loop instructions, removing non-instructions, etc. PyBrainfuck also has […]

Why Python Rocks II: Data structures

Okay. So what’s cool about Python? I can’t count the number of times I’ve had to show skeptics why Python is cool, what Python can do that their favorite language can’t do. So I’m writing a bunch of articles showing off Python’s Awesome. All articles in this series: Why Python Rocks I: Inline documentation Why […]

Breakpoint-induced Python debugging with IPython

Most of the Python programmers out there will know about IPython. Most of them will also know about the Python Debugger (PDB). IPython has an advanced version of PDB (spectacularly named ‘ipdb’) which does the same for PDB as IPython does for the normal interactive Python interpreter. It adds tab completion, color syntax highlighting, etc. […]

Why Python Rocks I: Inline documentation

Okay. So what’s cool about Python? I can’t count the number of times I’ve had to show skeptics why Python is cool, what Python can do that their favorite language can’t do. So I’m writing a bunch of articles showing off Python’s Awesome. All articles in this series: Why Python Rocks I: Inline documentation Why […]

Links

Here are some random links to interesting stuff: FirePHP FirePHP is a PHP debugging library and a Firefox plugin which allow you to output debugging information to the Firebug debugging panel. Since it doesn’t intermingle debugging information with your page output, but writes in a special HTTP header instead, it’s especially useful for AJAX debugging. […]

pyBrainfuck

For fun, I wrote a brainfuck interpreter in Python. Brainfuck is an esoteric (joke) programming language which is Turing-complete (given enough memory) with only 8 op-codes (instructions). It was designed to allow for the smallest possible compiler. There are already some other Brainfuck implementations in Python, but they are either obfuscated or extremely slow. pyBrainfuck […]

Python web app server in 48 lines

I needed to write a little application which would be accessible from a remote client, and which wouldn’t need any custom software running on the client. I needed a web application. But I didn’t feel like setting up a whole Apache web server with mod_python and whatever. Of course, there’s CherryPy, but it feels a […]

IPython – Interactive Python shell

(The latest version of this introduction to IPython can always be found here) Python has an interactive shell, which you can start by simply starting python: [todsah@jib]~$ python Python 2.4.4 (#2, Apr 5 2007, 20:11:18) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. >>> print(‘hello’) hello […]

The text of all posts on this blog, unless specificly mentioned otherwise, are licensed under this license.