<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Unmaintainable &#187; python</title>
	<atom:link href="http://unmaintainable.wordpress.com/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://unmaintainable.wordpress.com</link>
	<description>Scripting, Software Engineering and Stuff in Between</description>
	<lastBuildDate>Sun, 22 Nov 2009 09:05:47 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='unmaintainable.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/6f90ae5619dfc90140df401ac60575d2?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Unmaintainable &#187; python</title>
		<link>http://unmaintainable.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://unmaintainable.wordpress.com/osd.xml" title="Unmaintainable" />
		<item>
		<title>A Template for Python Unix Utilities</title>
		<link>http://unmaintainable.wordpress.com/2009/10/24/template-python-unix-utilities/</link>
		<comments>http://unmaintainable.wordpress.com/2009/10/24/template-python-unix-utilities/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 19:11:18 +0000</pubDate>
		<dc:creator>mafr</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://unmaintainable.wordpress.com/?p=337</guid>
		<description><![CDATA[One of the most often read postings on this blog is the one about my getopts-enabled shell script template. So I figured, a similar template in Python would also be useful. Like the shell script, it&#8217;s quite trivial, but it might still save some time.

The template is an example for a typical unix utility. It [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=337&subd=unmaintainable&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One of the most often read postings on this blog is the one about my getopts-enabled shell script template. So I figured, a similar template in Python would also be useful. Like the shell script, it&#8217;s quite trivial, but it might still save some time.</p>
<p><span id="more-337"></span></p>
<p>The template is an example for a typical unix utility. It connects two aspects: An <a href="http://docs.python.org/library/optparse.html">optparse</a>-based command line parser and iterating over multiple input sources using the <a href="http://docs.python.org/library/fileinput.html">fileinput module</a>.</p>
<p>I&#8217;ve used command line parsers in several programming languages, but from all of them, I liked Python&#8217;s <code>optparse</code> module best (for those who need it, the Python&#8217;s standard library still provides a classic <a href="http://docs.python.org/library/getopt.html">getopt</a>). The <code>fileinput</code> module is simple but useful. Beyond its main functionality, it supports more advanced features like transparent decompressing (not really Unix-like though) and in-place filtering of files, but I rarely ever use them.</p>
<p>Here&#8217;s <a href="http://dev.mafr.de/repos/hg/scripts/file/tip/bin/templates/unix-tool.py">the template</a> in my online Mercurial repository and here it is <a href="http://dev.mafr.de/repos/hg/scripts/raw-file/tip/bin/templates/unix-tool.py">for download</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unmaintainable.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unmaintainable.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unmaintainable.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unmaintainable.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unmaintainable.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unmaintainable.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unmaintainable.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unmaintainable.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unmaintainable.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unmaintainable.wordpress.com/337/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=337&subd=unmaintainable&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unmaintainable.wordpress.com/2009/10/24/template-python-unix-utilities/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59c9677a3b9569af44561adab6c2a980?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mafr</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick Tip #3: Creating Histograms in Python</title>
		<link>http://unmaintainable.wordpress.com/2009/09/10/creating-histograms-in-python/</link>
		<comments>http://unmaintainable.wordpress.com/2009/09/10/creating-histograms-in-python/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 14:09:37 +0000</pubDate>
		<dc:creator>mafr</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[quick tips]]></category>

		<guid isPermaLink="false">http://unmaintainable.wordpress.com/?p=326</guid>
		<description><![CDATA[Since Python 2.5, creating histograms has become easier. Instead of dict, we can now use defaultdict which is similar in behavior to awk&#8217;s associative arrays. Instead of raising a KeyError for undefined keys, defaultdict adds a user-defined item and returns it.

I&#8217;ll demonstrate this with a simple program that analyzes line length distribution in a file. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=326&subd=unmaintainable&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Since Python 2.5, creating histograms has become easier. Instead of <code>dict</code>, we can now use <code>defaultdict</code> which is similar in behavior to awk&#8217;s associative arrays. Instead of raising a <code>KeyError</code> for undefined keys, <code>defaultdict</code> adds a user-defined item and returns it.</p>
<p><span id="more-326"></span></p>
<p>I&#8217;ll demonstrate this with a simple program that analyzes line length distribution in a file. In older Python versions, you&#8217;d typically write code like this:</p>
<pre>
hist = { }
for line in open(filename):
    hist[len(line)] = hist.get(len(line), 0) + 1
</pre>
<p>The code using <code>defaultdict</code> is much clearer and more elegant (although an additional import is needed):</p>
<pre>
from collections import defaultdict

hist = defaultdict(int)
for line in open(filename):
    hist[len(line)] += 1
</pre>
<p>Note that <code>defaultdict</code>&#8217;s constructor expects a factory function that initializes unset items on request.</p>
<p>Unless you dump the contents of <code>hist</code> to gnuplot or similar, you might want to sort the <code>dict</code> by value. There are several ways to do this, but I learned from a <a href="http://blog.client9.com/2008/09/sorting-python-dictionary-by-value-take.html">related blog posting</a> that this is the most efficient way:</p>
<pre>
from operator import itemgetter
sorted(hist.iteritems(), key=itemgetter(1))
</pre>
<p>The <code>min</code> and <code>max</code> builtins support the <code>key</code> parameter, too, by the way.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unmaintainable.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unmaintainable.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unmaintainable.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unmaintainable.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unmaintainable.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unmaintainable.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unmaintainable.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unmaintainable.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unmaintainable.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unmaintainable.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=326&subd=unmaintainable&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unmaintainable.wordpress.com/2009/09/10/creating-histograms-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59c9677a3b9569af44561adab6c2a980?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mafr</media:title>
		</media:content>
	</item>
		<item>
		<title>Django on Google App Engine</title>
		<link>http://unmaintainable.wordpress.com/2009/02/22/django-on-google-app-engine/</link>
		<comments>http://unmaintainable.wordpress.com/2009/02/22/django-on-google-app-engine/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 19:35:51 +0000</pubDate>
		<dc:creator>mafr</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[scalability]]></category>

		<guid isPermaLink="false">http://unmaintainable.wordpress.com/?p=162</guid>
		<description><![CDATA[I&#8217;m back to playing with the Django web development framework again. Since I&#8217;m close to putting something online (it&#8217;s only a matter of years, actually), I&#8217;m also looking into hosting options. Due to the framework choice, Google App Engine appeared on my radar and I had a quick look at it.

Running your web application on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=162&subd=unmaintainable&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m back to playing with the <a href="http://www.djangoproject.com/">Django web development framework</a> again. Since I&#8217;m close to putting something online (it&#8217;s only a matter of years, actually), I&#8217;m also looking into hosting options. Due to the framework choice, <a href="http://code.google.com/appengine/">Google App Engine</a> appeared on my radar and I had a quick look at it.</p>
<p><span id="more-162"></span></p>
<p>Running your web application on Google&#8217;s infrastructure is certainly an intriguing idea. The official into video didn&#8217;t tell me too much, so I watched Guido van Rossum&#8217;s talk <a href="http://www.youtube.com/watch?v=v1gTI4BOPUw">Rapid Development with Python, Django and Google App Engine</a> on YouTube. Based on the information given there I decided against App Engine.</p>
<p>App Engine uses Google&#8217;s high performance distributed database system <a href="http://labs.google.com/papers/bigtable.html">Bigtable</a>. That&#8217;s pretty cool, but of course it works a lot different than a relational database. I&#8217;d have to port my application to Google&#8217;s persistence layer (not <em>that</em> much work yet) but I&#8217;d later be tied to a single hosting provider.</p>
<p>With the Django ORM framework out of the way, Django&#8217;s built-in generic admin site no longer works. This means, one of the framework&#8217;s biggest assets is lost and that&#8217;s the real show stopper for me. </p>
<p>If I were to create a highly scalable web application, the advantages would probably outweigh the disadvantages. But in my case, it means going back to comparing classic web hosters.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unmaintainable.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unmaintainable.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unmaintainable.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unmaintainable.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unmaintainable.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unmaintainable.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unmaintainable.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unmaintainable.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unmaintainable.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unmaintainable.wordpress.com/162/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=162&subd=unmaintainable&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unmaintainable.wordpress.com/2009/02/22/django-on-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59c9677a3b9569af44561adab6c2a980?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mafr</media:title>
		</media:content>
	</item>
		<item>
		<title>Transcoding Files to Ogg Vorbis</title>
		<link>http://unmaintainable.wordpress.com/2008/06/21/transcoding-to-ogg-vorbis/</link>
		<comments>http://unmaintainable.wordpress.com/2008/06/21/transcoding-to-ogg-vorbis/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 13:14:16 +0000</pubDate>
		<dc:creator>mafr</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://unmaintainable.wordpress.com/?p=56</guid>
		<description><![CDATA[I&#8217;ve got a nice MP3 player from Samsung with 2 GB of flash memory. That&#8217;s very little and I can never decide which files to keep and which to delete. Fortunately, the player also supports Ogg Vorbis files that require less space for the same quality. To make the most of my space, I transcode [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=56&subd=unmaintainable&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve got a nice MP3 player from Samsung with 2 GB of flash memory. That&#8217;s very little and I can never decide which files to keep and which to delete. Fortunately, the player also supports Ogg Vorbis files that require less space for the same quality. To make the most of my space, I transcode MP3s to Ogg using a simple python script.</p>
<p><span id="more-56"></span></p>
<p>The files in my music collection have all been ripped from CD and encoded to MP3 using lame&#8217;s &quot;&#8211;r3mix&quot; high quality VBR option. Because of that, the transcoding process doesn&#8217;t lose too much quality. I don&#8217;t hear a difference so I&#8217;m happy.</p>
<p>My <a href="http://musicbrainz.org/~matt/scripts/to-ogg.py">transcoding script</a> uses <a href="http://gstreamer.net/">GStreamer</a>, a media framework that supports all kinds of audio formats and transformations via its pipes and filters architecture. The framework supports file metadata (like ID3 tags), too, so it&#8217;s the perfect fit for transcoding files with little effort.</p>
<p>To transcode a set of MP3 files, let&#8217;s say an album that I just bought and ripped, I use the following command:</p>
<pre>
to-ogg.py -d /media/disk/ARTIST/ALBUM /PATH/TO/*.mp3
</pre>
<p>This takes the given MP3 files and transcodes them to Ogg Vorbis. The new files are created in the <cite>/media/disk/ARTIST/ALBUM/</cite> directory, with ID3 tags converted to Ogg comments. The directory is created on the fly, if necessary.</p>
<p>The script is flexible enough to accept all source formats that GStreamer supports. So, if you can play a file using rhythmbox (which also uses GStreamer as its backend), you can also convert the file to Ogg Vorbis.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unmaintainable.wordpress.com/56/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unmaintainable.wordpress.com/56/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unmaintainable.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unmaintainable.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unmaintainable.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unmaintainable.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unmaintainable.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unmaintainable.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unmaintainable.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unmaintainable.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unmaintainable.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unmaintainable.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=56&subd=unmaintainable&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unmaintainable.wordpress.com/2008/06/21/transcoding-to-ogg-vorbis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59c9677a3b9569af44561adab6c2a980?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mafr</media:title>
		</media:content>
	</item>
		<item>
		<title>Using ReStructured Text with WordPress</title>
		<link>http://unmaintainable.wordpress.com/2008/03/22/using-rst-with-wordpress/</link>
		<comments>http://unmaintainable.wordpress.com/2008/03/22/using-rst-with-wordpress/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 15:36:21 +0000</pubDate>
		<dc:creator>mafr</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://unmaintainable.wordpress.com/?p=50</guid>
		<description><![CDATA[Writing long documents in a browser input box isn&#8217;t the most pleasant thing to do. The WordPress builtin editor makes things even more inconvenient by forcing you to write your articles in HTML. It would be pretty cool if you could edit articles in a simple, readable format using your favorite text editor. Fortunately, there&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=50&subd=unmaintainable&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Writing long documents in a browser input box isn&#8217;t the most pleasant thing to do. The WordPress builtin editor makes things even more inconvenient by forcing you to write your articles in HTML. It would be pretty cool if you could edit articles in a simple, readable format using your favorite text editor. Fortunately, there&#8217;s ReStructured Text, a document format frequently used in the Python community.</p>
<p><span id="more-50"></span></p>
<p><a href="http://docutils.sourceforge.net/rst.html">ReStructured Text</a> (rst) is a pleasant plain text format that can be converted into different formats like HTML or LaTeX. The format is pretty intuitive and well suited for typical blog postings with a bit of formatting and a few links (see <a href="http://musicbrainz.org/~matt/misc/ruby-scala-scheme.txt">this example</a>). Of course, there are also more powerful features, but I don&#8217;t use many of them in my articles.</p>
<p>The rst distribution comes with several converter scripts, but none of them is perfectly suited for WordPress. The HTML syntax WordPress uses is slightly simplified and we need just the body, not a full HTML document. Using the rst2s5 converter as a reference I wrote my own converter: <a href="http://musicbrainz.org/~matt/scripts/rst2wp">rst2wp</a>.</p>
<p>The rst distribution contains a library that parses the text format and turns it into a document tree. A writer class then translates the document tree into a writer-specific format (HTML, LaTeX, S5, &#8230;). All I had to do was to inherit from the standard HTMLTranslator class and override all parts of the document I wasn&#8217;t interested in. The HTMLTranslator follows the visitor pattern so it&#8217;s pretty easy to understand.</p>
<p>Using <a href="http://musicbrainz.org/~matt/scripts/rst2wp">rst2wp</a> my workflow for posting an article works like this:</p>
<ol class="arabic">
<li>Write the article in rst format.</li>
<li>Check it into my <a href="http://www.selenic.com/mercurial/wiki/">Mercurial</a> repository.</li>
<li>Run rst2wp to turn the article into HTML.</li>
<li>Paste the output into the browser&#8217;s input box.</li>
</ol>
<p>The script works well for me, but I didn&#8217;t test the more advanced features of rst so there&#8217;s a good chance that they won&#8217;t work. Feel free to tweak the script to your needs, the code is pretty simple. A possible next step would be to write a tool for posting the article directly via WordPress&#8217; web service. But I&#8217;ll leave that for another day.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unmaintainable.wordpress.com/50/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unmaintainable.wordpress.com/50/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unmaintainable.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unmaintainable.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unmaintainable.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unmaintainable.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unmaintainable.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unmaintainable.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unmaintainable.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unmaintainable.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unmaintainable.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unmaintainable.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=50&subd=unmaintainable&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unmaintainable.wordpress.com/2008/03/22/using-rst-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59c9677a3b9569af44561adab6c2a980?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mafr</media:title>
		</media:content>
	</item>
		<item>
		<title>Map/Reduce in Python</title>
		<link>http://unmaintainable.wordpress.com/2007/10/28/map-reduce-in-python/</link>
		<comments>http://unmaintainable.wordpress.com/2007/10/28/map-reduce-in-python/#comments</comments>
		<pubDate>Sun, 28 Oct 2007 09:28:22 +0000</pubDate>
		<dc:creator>mafr</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://unmaintainable.wordpress.com/2007/10/28/map-reduce-in-python/</guid>
		<description><![CDATA[My interest in Grid Computing over the last weeks begins to show. After reading the Google MapReduce paper, I tried my fingers on a client side toy problem.
For formatting purposes, I was interested in the size of the longest string in a sequence. There are lots of ways to do this, but I wanted to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=32&subd=unmaintainable&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My interest in Grid Computing over the last weeks begins to show. After reading the <a href="http://labs.google.com/papers/mapreduce.html">Google MapReduce</a> paper, I tried my fingers on a client side toy problem.</p>
<p>For formatting purposes, I was interested in the size of the longest string in a sequence. There are lots of ways to do this, but I wanted to try Python&#8217;s <code>map</code> and <code>reduce</code> functions.</p>
<p><span id="more-32"></span></p>
<p>This is my sample input sequence:</p>
<pre>
  values = ('abc', 'xy', 'abcdef', 'xyz')
</pre>
<p>The first step is to transform the <code>values</code> sequence into a new list which contains the lengths of each string:</p>
<pre>
  mapped = map(lambda x: len(x), values)
</pre>
<p>After that, the <code>mapped</code> list is reduced to a single value:</p>
<pre>
  max_len = reduce(lambda x, y: max(x, y), mapped)
</pre>
<p>Both user-defined map and reduce functions are associative and commutative, so this task can be parallelized easily. In fact, I could in theory hand each map operation off to a different node in a grid. Because of the <code>max</code> function&#8217;s properties, the reduce could be executed in multiple steps on a grid, too.</p>
<p>BTW: While map/reduce was a nice experiment, I used a different implementation in the end, using list comprehension and the powerful <code>max()</code> function:</p>
<pre>
  max( [len(x) for x in values] )
</pre>
<p>If I had been interested in the longest string itself, I would have used the following (python-2.5 only):</p>
<pre>
  max(values, key=lambda x: len(x))
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unmaintainable.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unmaintainable.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unmaintainable.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unmaintainable.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unmaintainable.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unmaintainable.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unmaintainable.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unmaintainable.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unmaintainable.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unmaintainable.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unmaintainable.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unmaintainable.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=32&subd=unmaintainable&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unmaintainable.wordpress.com/2007/10/28/map-reduce-in-python/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59c9677a3b9569af44561adab6c2a980?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mafr</media:title>
		</media:content>
	</item>
		<item>
		<title>Writing a Minimal Web Server in Python</title>
		<link>http://unmaintainable.wordpress.com/2007/02/03/writing-a-web-server-in-python/</link>
		<comments>http://unmaintainable.wordpress.com/2007/02/03/writing-a-web-server-in-python/#comments</comments>
		<pubDate>Sat, 03 Feb 2007 10:34:26 +0000</pubDate>
		<dc:creator>mafr</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://unmaintainable.wordpress.com/2007/02/03/writing-a-web-server-in-python/</guid>
		<description><![CDATA[Copying files from one host in your home network to another is easy using protocols like NFS or SMB. But if you just want to transfer a couple of files to a friend&#8217;s computer in a foreign network, you have a lot of setup work to do (at least on Linux boxes). It would be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=13&subd=unmaintainable&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Copying files from one host in your home network to another is easy using protocols like NFS or SMB. But if you just want to transfer a couple of files to a friend&#8217;s computer in a foreign network, you have a lot of setup work to do (at least on Linux boxes). It would be much easier to just run a web server and let the other host download the files via HTTP in a web browser. Unfortunately, web servers aren&#8217;t trivial to setup either.</p>
<p><span id="more-13"></span></p>
<p>Gladly, Python&#8217;s standard library comes with lots of useful modules: Among them are <a href="http://docs.python.org/lib/module-BaseHTTPServer.html">BaseHTTPServer</a> and <a href="http://docs.python.org/lib/module-SimpleHTTPServer.html">SimpleHTTPServer</a> which provide everything needed to implement a simple web server in pure python. The <code>SimpleHTTPServer.SimpleHTTPRequestHandler</code> class is a handler which serves the current working directory in a style similar to apache. Via your browser, you can click through directories and download individual files.</p>
<p>It was a matter of minutes to write the <a href="http://musicbrainz.org/~matt/scripts/servehttp">servehttp script</a>. The script accepts parameters to set the server&#8217;s port and for the directory to serve. Feel free to adjust it to your needs.</p>
<p>By the way: More advanced servers can be written using <a href="http://twistedmatrix.com">Twisted</a>, an extremely flexible tool kit for networking applications.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unmaintainable.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unmaintainable.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unmaintainable.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unmaintainable.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unmaintainable.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unmaintainable.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unmaintainable.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unmaintainable.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unmaintainable.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unmaintainable.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unmaintainable.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unmaintainable.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=13&subd=unmaintainable&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unmaintainable.wordpress.com/2007/02/03/writing-a-web-server-in-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59c9677a3b9569af44561adab6c2a980?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mafr</media:title>
		</media:content>
	</item>
		<item>
		<title>Controlling Firefox via Command Line</title>
		<link>http://unmaintainable.wordpress.com/2007/01/05/controlling-firefox-via-command-line/</link>
		<comments>http://unmaintainable.wordpress.com/2007/01/05/controlling-firefox-via-command-line/#comments</comments>
		<pubDate>Fri, 05 Jan 2007 18:35:44 +0000</pubDate>
		<dc:creator>mafr</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://unmaintainable.wordpress.com/2007/01/05/controlling-firefox-via-command-line/</guid>
		<description><![CDATA[Mozilla-based browsers like Firefox have inherited a useful feature from the good old Netscape Navigator: Controlling a running browser instance via the command line. Using command line options, you can open URLs or files inside your browser window without having to enter them in the address bar.

Suppose you&#8217;re working in a terminal and want to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=11&subd=unmaintainable&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Mozilla-based browsers like <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a> have inherited a useful feature from the good old Netscape Navigator: Controlling a running browser instance via the command line. Using command line options, you can open URLs or files inside your browser window without having to enter them in the address bar.</p>
<p><span id="more-11"></span></p>
<p>Suppose you&#8217;re working in a terminal and want to open an HTML file in your current working directory:</p>
<pre>
  firefox -remote "openurl(file://`pwd`/filename.html)"
</pre>
<p>Your browser should then open the file in a new tab.</p>
<p>Unfortunately, this is a lot to type, so I wrote a <a href="http://users.musicbrainz.org/~matt/scripts/b">python script</a> called <em>b</em> (for &#8220;browser&#8221;) which simplifies this. The command above can now be written like this:</p>
<pre>
  b filename.html
</pre>
<p>Any number of files may be given on the command line. The script supports absolute and relative file names, directories, and URLs. Whitespace and unprintable characters are handled correctly, too.</p>
<p>See <a href="http://www.mozilla.org/unix/remote.html">the documentation at mozilla.org</a> for more information about the remote control feature.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unmaintainable.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unmaintainable.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unmaintainable.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unmaintainable.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unmaintainable.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unmaintainable.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unmaintainable.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unmaintainable.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unmaintainable.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unmaintainable.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unmaintainable.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unmaintainable.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=11&subd=unmaintainable&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unmaintainable.wordpress.com/2007/01/05/controlling-firefox-via-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59c9677a3b9569af44561adab6c2a980?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mafr</media:title>
		</media:content>
	</item>
		<item>
		<title>Controlling Rhythmbox using D-Bus</title>
		<link>http://unmaintainable.wordpress.com/2006/12/10/controlling-rhythmbox-using-dbus/</link>
		<comments>http://unmaintainable.wordpress.com/2006/12/10/controlling-rhythmbox-using-dbus/#comments</comments>
		<pubDate>Sun, 10 Dec 2006 19:06:23 +0000</pubDate>
		<dc:creator>mafr</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://unmaintainable.wordpress.com/2006/12/10/controlling-rhythmbox-using-dbus/</guid>
		<description><![CDATA[On GNOME desktops, the D-Bus IPC standard has superseded the CORBA-based approach. Using D-Bus, the operating system can notify the desktop about hardware changes and applications can communicate with each other in a standardized, simple manner. Using signals it is also possible to get a notification in case there are changes in a remote application.
In [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=4&subd=unmaintainable&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>On <a href="http://gnome.org">GNOME</a> desktops, the <a href="http://dbus.freedesktop.org">D-Bus</a> IPC standard has superseded the CORBA-based approach. Using D-Bus, the operating system can notify the desktop about hardware changes and applications can communicate with each other in a standardized, simple manner. Using <em>signals</em> it is also possible to get a notification in case there are changes in a remote application.</p>
<p>In this posting I&#8217;ll give a simple example on how to control the <a href="http://rhythmbox.org">Rhythmbox</a> audio player remotely using the <a href="http://www.freedesktop.org/wiki/Software_2fDBusBindings">python bindings</a>.</p>
<p><span id="more-4"></span></p>
<p>Similar to CORBA&#8217;s IDL, there is an XML-based interface description language. Using this language, applications can announce the methods (including signatures) they provide for others to call. To execute a method, you have to know four things:</p>
<ol>
<li>The service (in this case <code>org.gnome.Rhythmbox</code>)</li>
<li>The name of the remote object. Rhythmbox registers three objects for us to use: <code>/org/gnome/Rhythmbox/Player</code>, <code>/org/gnome/Rhythmbox/Shell</code>, and <code>/org/gnome/Rhythmbox/PlaylistManager</code></li>
<li>The interface (<code>org.gnome.Rhythmbox.Player</code> in this example)</li>
<li>The method and its signature (<code>getPlayingUri()</code>)</li>
</ol>
<p>Strictly speaking, the interface isn&#8217;t necessary, but an object is allowed to provide multiple methods with the same name and signature. In this case, the interface can be used to the access the desired method.</p>
<p>Let&#8217;s use python to print the URI of the currently playing song:</p>
<pre>
#! /usr/bin/env python
import dbus

session_bus = dbus.SessionBus()

proxy_obj = session_bus.get_object(
    'org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Player')

player = dbus.Interface(proxy_obj, 'org.gnome.Rhythmbox.Player')

print player.getPlayingUri()
</pre>
<p>This is pretty straight forward. We obtain a <code>dbus.Bus</code> instance (additionally to the SessionBus there is also a SystemBus) and use it to get an object reference to the player. Like in CORBA, a proxy object is used which takes care of all the marshalling and unmarshalling for us. The first argument of <code>get_object()</code> is the name of the service, the second one names the object we&#8217;re interested in using an <em>object path</em>.</p>
<p>We select the interface (the object supports more, but we don&#8217;t care about them) and then call the <code>getPlayingUri</code> method. Pretty simple, hm?</p>
<p>Rhythmbox offers a lot more than that: You can pause the player, adjust the volume, or print the name of the currently playing song. The D-Bus interface definitions can be found in XML files in the <a href="http://svn.gnome.org/viewcvs/rhythmbox/trunk/shell/">source distribution</a>. For more information about D-Bus see the <a href="http://dbus.freedesktop.org/doc/dbus-tutorial.html">D-Bus Tutorial</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unmaintainable.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unmaintainable.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unmaintainable.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unmaintainable.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unmaintainable.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unmaintainable.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unmaintainable.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unmaintainable.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unmaintainable.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unmaintainable.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unmaintainable.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unmaintainable.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=4&subd=unmaintainable&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unmaintainable.wordpress.com/2006/12/10/controlling-rhythmbox-using-dbus/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59c9677a3b9569af44561adab6c2a980?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mafr</media:title>
		</media:content>
	</item>
		<item>
		<title>Line Editing for the Python Interpreter</title>
		<link>http://unmaintainable.wordpress.com/2006/12/02/python-line-editing/</link>
		<comments>http://unmaintainable.wordpress.com/2006/12/02/python-line-editing/#comments</comments>
		<pubDate>Sat, 02 Dec 2006 09:50:15 +0000</pubDate>
		<dc:creator>mafr</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://unmaintainable.wordpress.com/2006/12/02/python-startup/</guid>
		<description><![CDATA[The interactive python interpreter is a highly useful tool. When writing python code, I always run it in a terminal to test things and to access the documentation. Unfortunately, the built-in line editing capabilities are limited: There&#8217;s no history, tab-completion, or other advanced editing features that shells like bash provide. Few people seem to know [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=3&subd=unmaintainable&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The interactive python interpreter is a highly useful tool. When writing python code, I always run it in a terminal to test things and to access the documentation. Unfortunately, the built-in line editing capabilities are limited: There&#8217;s no history, tab-completion, or other advanced editing features that shells like bash provide. Few people seem to know that it&#8217;s simple to add all of that using a few lines of code.</p>
<p><span id="more-3"></span></p>
<p>Like bash, the python interpreter can use readline on Unix systems:</p>
<pre>
try:
	import readline
except ImportError:
	print 'Module readline not available.'
else:
	import rlcompleter
	readline.parse_and_bind('tab: complete')
</pre>
<p>This code from the rlcompleter module&#8217;s documentation has to be executed at startup, so python&#8217;s <code>PYTHONSTARTUP</code> mechanism comes to help. Save it to a file (it doesn&#8217;t have to be executable) and let the <code>PYTHONSTARTUP</code> environment variable point to its location. On my system, I created a file <code>~/.pythonstartup.py</code> and set the environment variable in my shell&#8217;s profile:</p>
<pre>
export PYTHONSTARTUP=~/.pythonstartup.py
</pre>
<p>To test this, start the python interpreter, and import the <code>sys</code> module. Then type <code>sys.</code> and hit the tab key. A list of attributes and functions available in the module should be displayed.</p>
<p>That&#8217;s pretty cool already, but it&#8217;s not all there is to it. See the <a href="http://docs.python.org/lib/module-readline.html">readline module&#8217;s documentation</a> and the example there for what&#8217;s possible.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unmaintainable.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unmaintainable.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unmaintainable.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unmaintainable.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unmaintainable.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unmaintainable.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unmaintainable.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unmaintainable.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unmaintainable.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unmaintainable.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unmaintainable.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unmaintainable.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unmaintainable.wordpress.com&blog=586265&post=3&subd=unmaintainable&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unmaintainable.wordpress.com/2006/12/02/python-line-editing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59c9677a3b9569af44561adab6c2a980?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">mafr</media:title>
		</media:content>
	</item>
	</channel>
</rss>