Python IDE wanted, good, cheap and fast. :)

When editing Python text, I usually use emacs on Linux and XEmacs on Windows. However, I would love a cross-platform Python development environment in the style of Visual Slickedit or similar. It should have code-completion (for the umpteenth time, dabbrev in emacs is NOT code-completion!), it should show calltips (incorporating the relevant docstrings) when I’m instantiating objects or calling functions and it should have some kind of graphical object browser. It’s syntax highlighting and auto-indentation should be at least as good as that of emacs. Emacs has caught numerous programming errors before they even happened due to its auto-indentation.

Read More

Crash Different

MijKopThee, a popular Dutch blog, has a link to this cool clip of very, err, enthusiastic Mac user. Be warned, it needs a Windows Media 9 codec. Doh. For your reference, I like Macs. *pet pet*1 1 I’m petting my virtual Mac. Update September 13, 2010: Charlette reported in the comments below that the clip linked to above has disappeared. Some searching seems to indicate that the below Youtube clip is the same:

Read More

I’ve just been reloaded

Finally I too went to see Reloaded. We went to a particularly cozy little cinema in Delft called The Apollo. This is a “Service Bioscoop”, meaning that you have a little table in front of you and can press a button to have a waiter pop by and serve your favourite drinks and snacks. Smoking is also allowed. As we haven’t been taking part in this in- and exhalation-driven activity for a while now, this point isn’t so high up on the list of advantages, but it definitely does contribute to the cozy atmosphere.

Read More

Swapping variables without a temporary

This is from the first recipe in my brand-new Python cookbook. It’s quite obvious, but it hasn’t really struck me before. Well doh. In most languages, swapping the values in two variables means using an intermediate temporary variable, e.g.: <br /> int a = 1;<br /> int b = 2;<br /> int temp;<br /> temp = a;<br /> a = b;<br /> b = temp;<br /> With the tuple packing and unpacking in Python however, we don’t need no steenking temporary variables!

Read More

A quick Python note

Have a look at this brief snippet: In [2]: a = range(10) In [3]: 3 in a Out[3]: 1 In [4]: 3 not in a Out[4]: 0 In [5]: not (3 in a) Out[5]: 0 Input/output 4 should strike you as a tad strange if you don’t know Python that well but are familiar with similar constructs in other languages. At first glance, it almost seems like the sense of an operator can be negated with the not operator.

Read More

Python new-style objects and __slots__

This should be very useful: <br /> In [5]: class oldObject:<br /> ...: ....def __init__(self):<br /> ...: ........self.someVar = 1<br /> ...:<br /> In [6]: o1 = oldObject()<br /> In [7]: o1.someVar = 2<br /> In [8]: o1.someOtherVar = 3<br /> This is of course expected behaviour. Have a look at this though: <br /> In [9]: class newObject(object):<br /> ...: ....__slots__ = ['someVar']<br /> ...: ....def __init__(self):<br /> .

Read More

Python bookses

I broke down and ordered Python in a Nutshell by the Python guru Alex Martelli as well as The Python Cookbook, edited by Alex Martelli and David Ascher. Amazon UK will now proceed to bend my credit card even further, but that’s okay. It’s really flexible. EET VILL INCREEEZE MY PYTHON POWERS 10-FOLD, UND ZEN I VILL TAKE OVER DE WORLD!

Read More

Where are the frikking WMDs?

Yes, where are those Weapons of Mass Destruction that the US was warning everybody about? Those same WMDs that were used as some of the primary excuses for violating Iraq have not popped up yet, it seems. Funny… In related news, this article reports that there was a certain pressure by the US administration on the intelligence services to generate reports that would help to convince the public that attacking Iraq was urgent business.

Read More