Simon Willison’s Weblog

Subscribe
Atom feed for python

1,146 posts tagged “python”

The Python programming language.

2006

Python Web Developer Appliance. A VMWare virtual machine with Python web developer frameworks pre-installed for you.

# 29th June 2006, 6:58 pm / python

Solving Every Sudoku Puzzle. 100 lines of Python illustrating some key concepts in AI.

# 22nd June 2006, 10:46 am / peter-norvig, ai, python

Exciting stuff in Python 2.5

Python 2.5 alpha 1 is out, and as usual the What’s New in Python 2.5 document provides a pleasant overview of the new features. There are some real treats in there. While I’m hoping that the syntax for conditional expressions will grow on me, I’m looking forward to Partial function application becoming a common Python idiom. Relative imports are going to make Django applications a lot easier to redistribute, and I can’t wait to see all the crazy hacks that result from the introduction of coroutines.

[... 291 words]

2005

Things I learned at EuroOSCON

Last week was the first ever O’Reilly European Open Source Convention, held in the magnificent NH Grand Hotel Krasnapolsky in Amsterdam. It was the first big budget conference I’d been too (previously I’ve stuck to less expensive affairs such as SxSW Interactive and PyCon) but the money seems to have been well spent. The venue was fantastic and there was a great line-up of speakers, keynotes and panels.

[... 878 words]

Python programming job at Columbia University. Ignore the jargon—a little birdie tells me this is a Python job.

# 17th June 2005, 11 pm / python

[pypy-dev] PyPy released! A full Python implementation written in Python.

# 25th May 2005, 12:52 pm / python, pypy

lxml (via) A Pythonic wrapper for libxml2.

# 13th April 2005, 5:04 pm / libxml2, python, xml

Stricter Whitespace Enforcement. Finally! Guido tightens the rules on whitespace.

# 1st April 2005, 2:23 pm / guido-van-rossum, python

scrape.py. A clever Python screen-scraping module, with similarities to WWW::Mechanize.

# 25th March 2005, 5:09 am / scraping, python

2004

Python Grimoire. How to perform common tasks in Python.

# 23rd December 2004, 2:05 am / python

Python Parsing Tools (via) Ned’s compilation of Python parsing libraries.

# 30th November 2004, 2:53 pm / python, ned-batchelder

Python Memory Management (via) It’s not quite as straight forward as you might have thought.

# 8th November 2004, 12:43 pm / python

Cache decorator in Python 2.4 (via) Nothing like a good example to understand why decorators are a cool language feature.

# 1st November 2004, 1:15 pm / python

Running Pydoc under mod_python

I’ve written about pydoc before. In my opinion it’s one of Python’s best kept secrets: a way of instantly browsing the properties, methods and documentation strings of any module available to the Python environment. It can even run a local HTTP server to allow for easy browsing of available documentation.

[... 372 words]

Python in Air Traffic Control (via) Python goes mission critical.

# 18th August 2004, 6:13 am / python

Python will assimilate you (via) “From the wind-up school of technology strategizing”

# 8th August 2004, 6:49 pm / python

The Observer Pattern in Python (via) Makes smart use of weak references.

# 16th June 2004, 11:55 pm / python

Backporting from Python 2.3 to Python 2.2

We have a home-grown templating system at work, which I intend to dedicate an entry to some time in the future. We originally wrote it in Python 2.2, but upgraded to Python 2.3 a while ago and have since been evolving our code in that environment. Today I found a need to load the most recent version of our templating system on to a small, long neglected application that had been running the original version ever since it had enough features to be usable.

[... 356 words]

Switch statements in Python

Python doesn’t support a native switch statement. I’ve found myself using the following coding idiom instead recently which seems to work pretty well:

[... 114 words]

Python in Mathematics

Python in the Mathematics Curriculum by Kirby Urner is something of a sprawling masterpiece. It really comes in four parts: the first is a history of computer science in education, the second an appraisal of the impact of open source on education and the world at last, the third a dive in to the things that make Python so suitable for enhancing the mathematics curriculum and the fourth a discussion of how computer science and traditional mathematics are likely to play off against each other in the field of high school education.

[... 319 words]

Python Cookbook: Parsing the command line (via) Using optparse, but with the command line setup options stored in the program’s docstring.

# 19th April 2004, 1:51 pm / python

Panther, Python, and CoreGraphics (via) I didn’t realise Apple shipped special custom Python modules with OS X.

# 26th March 2004, 1:57 am / python

PHP 5 Release Candidate 1

I haven’t blogged much about PHP in a while because I’ve been up to my nose in mod_python and loving every minute of it. This news is just too important to miss: PHP 5 Release Candidate 1 has been released, bringing the first production-ready release tantilisingly close. While I doubt PHP 5 will tempt me back it’s definitely an exciting upgrade—my biggest complaint with PHP 4 is the brain-dead object model which defaults to copying whole objects rather than passing references, and this is one of the many things addressed by PHP 5. The new libxml2 powered XML features sound really powerful, and SQLite as an on-board database should be ideal for knocking out small stand-alone applications without needing to set up a mySQL database for them.

[... 173 words]

Advanced Python network programming

Understanding Network I/O, Part 2 by George Belotsky (via The Farm) is the best tutorial on the subject of network programming I’ve seen yet. It provides a detailed explanation of simple threaded network clients, thread pools using the Queue module and asynchronous I/O using both Twisted and Python’s asyncore library—then discusses the strengths and weaknesses of each approach.

[... 93 words]