<?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/"
	>

<channel>
	<title>indiWiz.com &#187; python</title>
	<atom:link href="http://indiwiz.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://indiwiz.com</link>
	<description>Subhash&#039;s Tech Log</description>
	<lastBuildDate>Wed, 03 Mar 2010 13:24:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Tornado (the Python WebServer/Framework behind FriendFeed) goes OpenSource</title>
		<link>http://indiwiz.com/2009/09/11/tornado-the-python-webserverframework-behind-friendfeed-goes-opensource/</link>
		<comments>http://indiwiz.com/2009/09/11/tornado-the-python-webserverframework-behind-friendfeed-goes-opensource/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 05:40:46 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[webframework]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=491</guid>
		<description><![CDATA[Post acquisition by Facebook, the software behind FriendFeed has been OpenSourced. Tornado is a Python WebServer/Framework. The distinguishing feature of this WebServer is that it is non-blocking and designed for high-scalability. Facebook in the past has OpenSourced many of their frameworks and tools. Share this on del.icio.us Digg this! Post this on Diigo Share this [...]]]></description>
			<content:encoded><![CDATA[<p>Post acquisition by <a href="http://facebook.com/">Facebook</a>, the software behind <a href="http://friendfeed.com/">FriendFeed</a> has been OpenSourced. <a href="http://www.tornadoweb.org/">Tornado</a> is a Python WebServer/Framework. The distinguishing feature of this WebServer is that it is non-blocking and designed for high-scalability.</p>
<p>Facebook in the past has <a href="http://developers.facebook.com/opensource.php">OpenSourced many of their frameworks and tools</a>.</p>


<div class="shr-bookmarks shr-bookmarks-expand">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://indiwiz.com/2009/09/11/tornado-the-python-webserverframework-behind-friendfeed-goes-opensource/&amp;title=Tornado+%28the+Python+WebServer%2FFramework+behind+FriendFeed%29+goes+OpenSource" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://indiwiz.com/2009/09/11/tornado-the-python-webserverframework-behind-friendfeed-goes-opensource/&amp;title=Tornado+%28the+Python+WebServer%2FFramework+behind+FriendFeed%29+goes+OpenSource" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://indiwiz.com/2009/09/11/tornado-the-python-webserverframework-behind-friendfeed-goes-opensource/&amp;title=Tornado+%28the+Python+WebServer%2FFramework+behind+FriendFeed%29+goes+OpenSource&amp;desc=Post%20acquisition%20by%20Facebook%2C%20the%20software%20behind%20FriendFeed%20has%20been%20OpenSourced.%20Tornado%20is%20a%20Python%20WebServer%2FFramework.%20The%20distinguishing%20feature%20of%20this%20WebServer%20is%20that%20it%20is%20non-blocking%20and%20designed%20for%20high-scalability.%0D%0AFacebook%20in%20the%20past%20has%20OpenSourced%20many%20of%20their%20frameworks%20and%20to" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://indiwiz.com/2009/09/11/tornado-the-python-webserverframework-behind-friendfeed-goes-opensource/&amp;t=Tornado+%28the+Python+WebServer%2FFramework+behind+FriendFeed%29+goes+OpenSource" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://indiwiz.com/2009/09/11/tornado-the-python-webserverframework-behind-friendfeed-goes-opensource/&amp;title=Tornado+%28the+Python+WebServer%2FFramework+behind+FriendFeed%29+goes+OpenSource&amp;summary=Post%20acquisition%20by%20Facebook%2C%20the%20software%20behind%20FriendFeed%20has%20been%20OpenSourced.%20Tornado%20is%20a%20Python%20WebServer%2FFramework.%20The%20distinguishing%20feature%20of%20this%20WebServer%20is%20that%20it%20is%20non-blocking%20and%20designed%20for%20high-scalability.%0D%0AFacebook%20in%20the%20past%20has%20OpenSourced%20many%20of%20their%20frameworks%20and%20to&amp;source=indiWiz.com" rel="nofollow" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://indiwiz.com/2009/09/11/tornado-the-python-webserverframework-behind-friendfeed-goes-opensource/&amp;title=Tornado+%28the+Python+WebServer%2FFramework+behind+FriendFeed%29+goes+OpenSource" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/09/11/tornado-the-python-webserverframework-behind-friendfeed-goes-opensource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python 3.0 Released</title>
		<link>http://indiwiz.com/2008/12/08/python-30-released/</link>
		<comments>http://indiwiz.com/2008/12/08/python-30-released/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 04:52:10 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=46</guid>
		<description><![CDATA[My language of preference after Java, has a new release: 3.0. This is an interesting release as it breaks backwards compatibility. A conversion tool for 2.0 code migration to 3.0 is also made available by the community. Share this on del.icio.us Digg this! Post this on Diigo Share this on Facebook Share this on LinkedIn [...]]]></description>
			<content:encoded><![CDATA[<p>My language of preference after Java, has a new release: <a href="http://python.org/download/releases/3.0/">3.0</a>. This is an interesting release as it <a href="http://docs.python.org/3.0/whatsnew/3.0.html">breaks backwards compatibility</a>. A <a href="http://svn.python.org/view/sandbox/trunk/2to3/">conversion tool</a> for 2.0 code migration to 3.0 is also <a href="http://svn.python.org/view/sandbox/trunk/2to3/">made available by the community</a>.</p>


<div class="shr-bookmarks shr-bookmarks-expand">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://indiwiz.com/2008/12/08/python-30-released/&amp;title=Python+3.0+Released" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://indiwiz.com/2008/12/08/python-30-released/&amp;title=Python+3.0+Released" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://indiwiz.com/2008/12/08/python-30-released/&amp;title=Python+3.0+Released&amp;desc=My%20language%20of%20preference%20after%20Java%2C%20has%20a%20new%20release%3A%203.0.%20This%20is%20an%20interesting%20release%20as%20it%20breaks%20backwards%20compatibility.%20A%20conversion%20tool%20for%202.0%20code%20migration%20to%203.0%20is%20also%20made%20available%20by%20the%20community." rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://indiwiz.com/2008/12/08/python-30-released/&amp;t=Python+3.0+Released" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://indiwiz.com/2008/12/08/python-30-released/&amp;title=Python+3.0+Released&amp;summary=My%20language%20of%20preference%20after%20Java%2C%20has%20a%20new%20release%3A%203.0.%20This%20is%20an%20interesting%20release%20as%20it%20breaks%20backwards%20compatibility.%20A%20conversion%20tool%20for%202.0%20code%20migration%20to%203.0%20is%20also%20made%20available%20by%20the%20community.&amp;source=indiWiz.com" rel="nofollow" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://indiwiz.com/2008/12/08/python-30-released/&amp;title=Python+3.0+Released" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2008/12/08/python-30-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beautiful Closures</title>
		<link>http://indiwiz.com/2008/11/18/beautiful-closures/</link>
		<comments>http://indiwiz.com/2008/11/18/beautiful-closures/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 08:27:54 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[closure]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://indiwiz.wordpress.com/?p=6</guid>
		<description><![CDATA[One of the irritating things when writing code in Java is when managing files or database resources. We have to write so much redundant code: File f = new File(&#34;/etc/passwd&#34;); BufferedReader br = null; try{ br = new BufferedReader(new FileReader(f)); String str; while((str=br.readLine())!=null){ System.out.println(str); } } catch(IOException ex){ ... } finally{ if(br != null){ try{ [...]]]></description>
			<content:encoded><![CDATA[<p>One of the irritating things when writing code in Java is when managing files or database resources. We have to write so much redundant code:</p>
<pre class="brush: java;">
File f = new File(&quot;/etc/passwd&quot;);
BufferedReader br = null;
try{
  br = new BufferedReader(new FileReader(f));
  String str;
  while((str=br.readLine())!=null){
    System.out.println(str);
  }
}
catch(IOException ex){
  ...
}
finally{
  if(br != null){
    try{
      br.close();
    }
    catch(IOException ex){
      ...
    }
  }
}
</pre>
<p>So much redundancy is ground for human errors. Issues like these are beautifully solved using programming concept called Closures. For example, in the newly released 2.6 version of Python, the same would be written as:</p>
<pre class="brush: python;">
with open('/etc/passwd', 'r') as f:
    for line in f:
        print line
</pre>
<p>In the above code, even when an exception is raised during file read, the file is gracefully closed when the control exits with block. A similar example in Groovy:</p>
<pre class="brush: java;">
File f = new File(&quot;/etc/passwd&quot;)
f.eachLine{
  line -&gt;
  println line
}
</pre>
<p>Martin Fowler has written a short introduction to <a href="http://martinfowler.com/bliki/Closure.html">Closures</a>.</p>


<div class="shr-bookmarks shr-bookmarks-expand">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://indiwiz.com/2008/11/18/beautiful-closures/&amp;title=Beautiful+Closures" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://indiwiz.com/2008/11/18/beautiful-closures/&amp;title=Beautiful+Closures" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://indiwiz.com/2008/11/18/beautiful-closures/&amp;title=Beautiful+Closures&amp;desc=One%20of%20the%20irritating%20things%20when%20writing%20code%20in%20Java%20is%20when%20managing%20files%20or%20database%20resources.%20We%20have%20to%20write%20so%20much%20redundant%20code%3A%0A%0A%5Bsourcecode%20language%3D%27java%27%5D%0AFile%20f%20%3D%20new%20File%28%22%2Fetc%2Fpasswd%22%29%3B%0ABufferedReader%20br%20%3D%20null%3B%0Atry%7B%0A%20%20br%20%3D%20new%20BufferedReader%28new%20FileReader%28f%29%29%3B%0A%20%20String%20str%3B%0A%20%20w" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://indiwiz.com/2008/11/18/beautiful-closures/&amp;t=Beautiful+Closures" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://indiwiz.com/2008/11/18/beautiful-closures/&amp;title=Beautiful+Closures&amp;summary=One%20of%20the%20irritating%20things%20when%20writing%20code%20in%20Java%20is%20when%20managing%20files%20or%20database%20resources.%20We%20have%20to%20write%20so%20much%20redundant%20code%3A%0A%0A%5Bsourcecode%20language%3D%27java%27%5D%0AFile%20f%20%3D%20new%20File%28%22%2Fetc%2Fpasswd%22%29%3B%0ABufferedReader%20br%20%3D%20null%3B%0Atry%7B%0A%20%20br%20%3D%20new%20BufferedReader%28new%20FileReader%28f%29%29%3B%0A%20%20String%20str%3B%0A%20%20w&amp;source=indiWiz.com" rel="nofollow" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://indiwiz.com/2008/11/18/beautiful-closures/&amp;title=Beautiful+Closures" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2008/11/18/beautiful-closures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
