Uncategorized

Python’s Default Argument Values are Sticky

I can’t believe it’s taken me this long to learn this: Python’s default argument values are only evaluated once during runtime. I’ve never encountered this before because I don’t use default arguments very often, and when I do, it’s often to set something to a static value. Today, I encountered a function definition where I …

Python’s Default Argument Values are Sticky Read More »

Compile PyCrypto on Windows With Visual C++

Install Visual Studio 2008 SP1 Express Edition. Go to the command prompt. First, I had to set the following variable: C:>set VS90COMNTOOLS=C:Program FilesMicrosoft Visual Studio 9.0Common7Tools Note the trailing backslash – that needs to be there. The value must also NOT be in quotes. C:>cd “Program FilesMicrosoft Visual Studio 9.0vcbin” C:Program FilesMicrosoft Visual Studio 9.0VCbin>vcvars32 …

Compile PyCrypto on Windows With Visual C++ Read More »

Python – Enhance PyDev’s Code Completion

Because Python isn’t strongly typed, sometimes PyDev doesn’t know what type a variable is – and therefore it cannot give you accurate code completions. Here’s how to make that better. In simpler situations, PyDev works very well. For example: emp = Employee() Typing ’emp.’ will get you a good autocomplete. Now, let’s say you have …

Python – Enhance PyDev’s Code Completion Read More »