Simon Willison’s Weblog

Subscribe

1,023 items tagged “python”

The Python programming language.

2007

Two months with Ruby on Rails. Good rant—covers both the good and the bad. The first complaint is the lack of XSS protection by default in the template language. Django has the same problem, but the solution was 90% there when I saw Malcolm at OSCON.

# 9th October 2007, 12:23 pm / rails, django, python, ruby, xss, security

Writing An Hadoop MapReduce Program In Python. Hadoop (the open source map/reduce framework) can interact with any program that reads from stdin and outputs on stdout—so it’s trivial to drop in Python scripts for the map and reduce steps.

# 9th October 2007, 11:33 am / hadoop, mapreduce, python

tranquil. Inspired take on the Django ORM to SQLAlchemy problem: lets you define your models with the Django ORM but use SQLAlchemy to run queries against them.

# 9th October 2007, 2:30 am / sqlalchemy, python, django, orm, djangoorm, models, tranquil

String types in Python 3. bytes are now immutable (just like the bytestrings they are replacing) and a new mutable buffer type has been introduced.

# 9th October 2007, 2:08 am / bytes, buffers, bytestrings, unicode, python3, python, strings

Some Notes on Tim Bray’s Wide Finder Benchmark. Fredrik Lundh demonstrates some Python ninja techniques for parsing log files using multiple cores (and eventually memory mapping).

# 7th October 2007, 1:06 am / mmap, python, fredrik-lundh, effbot, tim-bray, benchmark, multicore

DbMigration—a schema migration tool for Django. Nice and simple tool for adding schema migrations to a Django application.

# 27th September 2007, 3:04 pm / django, orm, djangoorm, migrations, sql, python

lxml.cssselect (via) lxml includes an implementation of CSS 3 selectors, which compiles them to XPath expressions. Should be a useful tool for parsing Microformats from Python.

# 24th September 2007, 11:57 pm / python, lxml, libxml2, css, selectors, xpath, css3, microformats

Hello JS-CTYPES, Goodbye Binary Components. Mark Finkle is porting Python’s ctypes functionality to the Mozilla platform, to allow binary XPCOM components to be defined in pure JavaScript.

# 22nd September 2007, 11:57 pm / mark-finkle, ctypes, javascript, mozilla, python, xpcom

The Rubinius Sprint. Sun are throwing a ton of resources at Ruby, because as Tim Bray says, “it’s not fast enough”. Imagine where they’d be if they’d invested this kind of support in Jython five years ago...

# 21st September 2007, 11:32 pm / sourgrapes, python, jython, ruby, sun, tim-bray, rubinius, open-source, java

virtualenv 0.8.1. Ian Bicking’s tool for creating isolated Python environments; designed to replace his earlier workingenv package. Does anyone have any experience using this? It looks fantastically useful.

# 15th September 2007, 11:36 pm / python, virtualenv, ian-bicking

Zope3 for Djangoers. I prefer “Djangonauts”, personally. Useful overview of Zope 3 for people with Django experience (first of a multi-part series).

# 14th September 2007, 3:20 pm / django, djangonauts, zope, zope3, python

Restructured Text to Anything. Slick set of online tools for converting Restructured Text (one of the more mature wiki-style markup languages) to HTML or PDF. Includes a nice looking API. Powered by Django.

# 13th September 2007, 3:54 pm / django, restructuredtext, python, html, pdf

Building the Social Web with OpenID. Slides from my keynote at yesterday’s PyCon UK.

# 9th September 2007, 12:36 am / slides, openid, pyconuk2007, pyconuk, keynote, slideshare, socialweb, talks, python

django-sphinx (via) More code from Curse Gaming; this time a really nice API for adding Sphinx full-text search to a Django model.

# 9th September 2007, 12:35 am / django, python, orm, search, sphinx-search, fulltext, cursegaming, david-cramer

wikimarkup (via) “MediaWiki markup in Python”. I’ve always suspected that MediaWiki was like Perl; the only thing that can parse MediaWiki is MediaWiki. Not sure how faithful this Python port is but I’d love my theory to be proved wrong.

# 9th September 2007, 12:33 am / python, cursegaming, david-cramer, mediawiki, perl, wiki, wikimarkup

Advanced Django. Slides from my hour long tutorial at PyCon UK this morning. Most of the material was adapted from OSCON, but I also added a new section covering newforms.

# 8th September 2007, 1 pm / slides, pyconuk, newforms, django, pyconuk2007, slideshare, talks, tutorial, python

Django on Jython: What I’ve done until now. It’s not quite there yet (the new Jython is Python 2.2 with a few 2.3 features; Django requires 2.3 at least) but it’s looking pretty promising.

# 4th September 2007, 2:53 am / django, python, jython, java

Amazon EC2 Basics For Python Programmers. Detailed introduction and tutorial from James Gardner.

# 3rd September 2007, 6:20 pm / james-gardner, python, amazon, ec2, tutorial

calendar.timegm() (via) An “unrelated but handy function” that converts a time.gmtime() in to a corresponding Unix timestamp. I’ve been hand-rolling this one for years; never thought to look in calendar.

# 3rd September 2007, 1:54 am / python, sam-ruby, calendar, timezones, datetime, unixtimestamp, time

Sam Ruby: 2to3. Sam’s report on an attempt to port the Universal Feed Parser to Python 3.0. The 2to3 tool does most of the work, but it seems the unicode changes can be pretty tricky.

# 3rd September 2007, 1:38 am / unicode, python3, python, sam-ruby, 2to3, feedparser

Django vs feedparser on dates. Some useful tips in the comments. I find Python’s timezone stuff endlessly frustrating: I know it can do what I want, but it always takes me a ridiculously long time to figure out the necessary incantations.

# 2nd September 2007, 10:17 am / python, datetime, django, feedparser, timezones

What’s New in Python 3.0. They’re definitely taking advantage of the break in backwards compatibility—lots of niggling inconsistencies are finally being cleaned up.

# 1st September 2007, 1:41 am / python, python3

The use of double underscores creates a separate namespace for names that are part of the Python language definition, so that programmers are free to create variables, attributes, and methods that start with letters, without fear of silently colliding with names that have a language-defined purpose.

Ka-Ping Yee

# 1st September 2007, 1:30 am / ka-ping-yee, python

Python 3.0a1 released. Wow, that was a pretty fast turnaround. Betas are planned for 2008, with a final release scheduled for August.

# 31st August 2007, 8:36 pm / python3, python

Satchmo 0.5 Release. Django powered e-commerce application, “the webshop for perfectionists with deadlines”.

# 22nd August 2007, 10:36 pm / django, satchmo, releases, python

The Shrinking Python Web Framework World. Python used to suffer from a paradox of choice with regards to Web frameworks; today things are considerably easier for new developers.

# 22nd August 2007, 10:06 pm / python, ian-bicking

BabelDjango. Tools for integrating Christopher Lenz’s Babel i18n framework with Django.

# 20th August 2007, 2:59 pm / christopher-lenz, django, babel, python, i18n

Django on the iPhone. Jacob got it working. The next image in his photostream shows the Django admin application querying his phone’s local database of calls.

# 19th August 2007, 7:58 am / jacob-kaplan-moss, django, python, iphone, apple

The Python docs have been redesigned for 2.6. They’re beautiful. The docs for a module are on a single page now (rather than splitting over multiple pages), they’ve added unobtrusive permalinks to individual sections and the whole thing is built on ReST rather than LaTeX.

# 18th August 2007, 12:39 pm / rest, latex, documentation, python

Changeset 5925. You can now register custom commands for your application with Django’s manage.py script. More sensible than littering your application’s root directory with shell scripts.

# 18th August 2007, 11:06 am / django, python, managepy