<?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>Desi Penguin’s Blog &#187; Python</title>
	<atom:link href="http://desipenguin.com/techblog/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://desipenguin.com/techblog</link>
	<description>Open source, Tech Tips, Reviews, Tutorials and more …</description>
	<lastBuildDate>Tue, 29 Jun 2010 16:38:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Why SharpDevelop is better IDE ?</title>
		<link>http://desipenguin.com/techblog/2009/07/10/why-sharpdevelop-is-better-ide/</link>
		<comments>http://desipenguin.com/techblog/2009/07/10/why-sharpdevelop-is-better-ide/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 16:51:26 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://desipenguin.com/techblog/?p=316</guid>
		<description><![CDATA[



Image via Wikipedia



In my first post about IronPython, I documented how installing IronPython Studio was painful (Needed Visual Studio shell, which in itself was confusing). When I started with IronPython I did not know about any other IDE, hence I went ahead with IronPython Studio. But later I came to know about SharpDevelop.
My initial problem [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignleft" style="width: 266px;">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/Image:SharpDevelop.png"><img title="SharpDevelop" src="http://upload.wikimedia.org/wikipedia/en/thumb/b/b6/SharpDevelop.png/300px-SharpDevelop.png" alt="SharpDevelop" width="256" height="177" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/Image:SharpDevelop.png">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>In my <a href="http://desipenguin.com/techblog/2009/06/23/ironpython/" target="_blank">first post</a> about <a class="zem_slink" title="IronPython" rel="homepage" href="http://www.codeplex.com/IronPython">IronPython</a>, I documented how installing IronPython Studio was painful (Needed Visual Studio shell, which in itself was confusing). When I started with IronPython I did not know about any other IDE, hence I went ahead with IronPython Studio. But later I came to know about <a class="zem_slink" title="SharpDevelop" rel="homepage" href="http://sharpdevelop.com/">SharpDevelop</a>.</p>
<p>My initial problem with SharpDevelop was that it needed .NET 3.5 SP1 at the minimum. I had just gone through the painful exercise of downloading and installing the prerequisites for IronPython Studio. So I was in no mood of downloading another big chunk before I can start my IronPython Development. But once I got past my initial development cycle, I wanted to give Sharp Develop a try.</p>
<p>After using both the ID interchangeably, I finally settled on SharpDevelop as my choice for IronPython Development</p>
<h3><span id="more-316"></span></h3>
<h3>Why SharpDevelop ?</h3>
<blockquote><p><strong>#develop (short for SharpDevelop) is a free IDE for C#, VB.NET and Boo projects</strong> on Microsoft&#8217;s .NET platform</p></blockquote>
<p>To begin with it is completely free and open source. We like Open Source.  But IronPython Studio is also Free and Open Source. But it needs Visual Studio shell from MS.  There is nothing wrong with that, I think it is a design philosophy. IronPython Studio was probably built with the sole purpose of supporting IronPython IDE. So the developers must have assumed that anyone doing development on MS platform would typically use Visual Studio. Since MS has a free version of Visual Studio, cost is non-issue. That is why IronPython Studio is available in two modes : integrated mode and isolated mode.  Assuming that existence of Visual Studio shell helps in reducing the download size. While IronPython Studio was less than 1MB, Sharp Develop on the other hand is whopping 18 MB.</p>
<p>On the other hand, SharpDevelop was built from ground up with the goal of providing a completely open source alternative to Visual Studio. As the name suggests, probably very first language it supported was C#, and then added support for VB.NET and Boo (and IronPython as of 3.0) one by one.</p>
<h3>Support for Visual Studio Solution files</h3>
<p>While SharpDevelop aims to be complete alternative for Visual Studio, I think they realize that in real world there are bound to be projects which already have .sln files. So it is important to support .sln files. IronPython Studio on the other hand insists on creating its own .pysln files.</p>
<p>While .pysln may be OK for Standalone IronPython Development, SharpDevelop approach of supporting solution files will be useful when one tries to use IronPython code with other .NET languages like VB.Net and C# (To be fair both use .pyproj project files, which can be open interchangeably in any IDE &#8211; But IronPython Studio insisted on creating its own .pysln file when it opened .pyproj)</p>
<p>While I have not used integrated mode of IronPython Studio, SharpDevelop inherently supports multiple .NET languages. It also has feature to convert VB.net code into IronPython. Now how cool is that ?</p>
<h3>Third party tools</h3>
<p>One of the menu items in SharpDevelop is titled &#8220;Quality Tools&#8221;. I liked the fact that an IDE cares enough about the quality to integrate various third party tools. It has built in option for Profiler, <a class="zem_slink" title="StyleCop" rel="wikipedia" href="http://en.wikipedia.org/wiki/StyleCop">StyleCop</a>, <a class="zem_slink" title="FxCop" rel="wikipedia" href="http://en.wikipedia.org/wiki/FxCop">FxCop</a>, as well as <a class="zem_slink" title="NUnit" rel="homepage" href="http://www.nunit.com/">NUnit</a>.  Some of these tools require a third party DLL to work, but that is fair enough.</p>
<p>SharpDevelop also recognized that <a class="zem_slink" title="TortoiseSVN" rel="homepage" href="http://tortoisesvn.tigris.org">TortoiseSVN</a> was installed and supported Subversion operations from within the IDE. On the other hand,  free Visual Studio plugin for SVN &#8211; <a class="zem_slink" title="AnkhSVN" rel="homepage" href="http://ankhsvn.net/">AnkhSVN</a> &#8211; doesn&#8217;t work with free (Express) version of Visual Studio.</p>
<p>So does that mean SharpDevelop is the ultimate IDE for IronPython development ? Not quite. There are certain things that didn&#8217;t quite work for me.</p>
<h3>Code completion missing ?</h3>
<p>Since most of my development has been on *nix platform, I haven&#8217;t used much of IDEs. I used Eclipse once is a while for some Java Development, but always felt it to be slow. For pure Python development, I prefer <a class="zem_slink" title="ActiveState Komodo" rel="homepage" href="http://www.activestate.com/komodo/">Komodo free IDE</a> on both Ubuntu as well as Windows.  I have also tried Eclipse 3.5 with built-in support for Dynamic languages for Python development on Ubuntu. But none of these provided the auto completion (or intellisense as sometimes it is referred) feature for python/ironpython. I read on one of the blogs that SharpDevelop 3.1 supports code completion for IronPython, but for some reason I was not able to get it working for me (Please let me know in comments, if you know of any configuration that may be required for this)</p>
<h3>Folding doesn&#8217;t quite work</h3>
<p>Another big feature I missed (as compated to Komodo free version) was how folding worked. SharpDevelop support folding only for the code inside a class. Most of code is outside of any of the classess &#8211; so I get no folding. Komodo on the other hand support folding for as small as if block.</p>
<h3>Closing Remarks</h3>
<p>In coming days, I need to integrate my code with VB.Net application. I plan to use SharpDevelop for the entire development. If my colleagues can&#8217;t figure out that I am not using Visual Studio, I may suggest the rest of the development team to also try SharpDevelop (and save some buck for the organization &#8211; that would be pretty big saving)</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 460px; width: 1px; height: 1px;">in comments</div>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/41035723-ab8c-4afa-a80a-aa40c8e97aae/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=41035723-ab8c-4afa-a80a-aa40c8e97aae" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2009/07/10/why-sharpdevelop-is-better-ide/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reading CSV files in IronPython</title>
		<link>http://desipenguin.com/techblog/2009/07/03/reading-csv-files-in-ironpython/</link>
		<comments>http://desipenguin.com/techblog/2009/07/03/reading-csv-files-in-ironpython/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 16:13:12 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[IronPython]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://desipenguin.com/techblog/?p=294</guid>
		<description><![CDATA[



Image via Wikipedia



This is in continuation with my previous blog post :
To get IronPython to use Standard Python Modules,  one needs to add  the following two lines to C:\IronPython-2.0.1\Lib\site.py :
import sys
sys.path.append(r"C:\Python25\Lib")
While this works for most part, it doesn’t help if you are using Python extensions written in C. More about my specific problems in [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 123px;">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/Image:CsvDelimited001.svg"><img title="stylized depiction of a csv text file" src="http://upload.wikimedia.org/wikipedia/en/thumb/3/38/CsvDelimited001.svg/113px-CsvDelimited001.svg.png" alt="stylized depiction of a csv text file" width="113" height="113" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/Image:CsvDelimited001.svg">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>This is in continuation with my <a href="http://desipenguin.com/techblog/2009/06/23/ironpython/" target="_blank">previous</a> blog post :</p>
<blockquote><p><span>To get <a class="zem_slink" title="IronPython" rel="homepage" href="http://www.codeplex.com/IronPython">IronPython</a> to use Standard <a class="zem_slink" title="Python (programming language)" rel="homepage" href="http://www.python.org/">Python</a> Modules,  one needs to</span> add  the following two lines to <em>C:\IronPython-2.0.1\Lib\site.py</em> :</p>
<pre>import sys
sys.path.append(r"C:\Python25\Lib")</pre>
<p>While this works for most part, it doesn’t help if you are using Python extensions written in C. More about my specific problems in another post. But there is an open source project <a href="http://code.google.com/p/ironclad/" target="_blank">IronClad</a> to deal specifically with this issue. In the meantime, you can check  <a href="http://ironpython.codeplex.com/Wiki/View.aspx?title=Differences" target="_blank">the differences between IronPython and CPython</a></p></blockquote>
<p>Reading (and writing to) <a class="zem_slink" title="Comma-separated values" rel="wikipedia" href="http://en.wikipedia.org/wiki/Comma-separated_values">CSV</a> file is critical part of my program, while in stadard python it was as easy as &#8220;import csv&#8221;, the same thing took some efforts to get it working in IronPython. I got the following error for my import statement</p>
<pre>Error on line 7 in csv.py
from functools import reduce</pre>
<p>I also tried using <a class="zem_slink" title="ActivePython" rel="wikipedia" href="http://en.wikipedia.org/wiki/ActivePython">ActiveState Python</a> 2.5.2.2 (which I already had from few months ago, didn&#8217;t feel like downloading the latest version till the problem was fixed) But that didn&#8217;t help either. With ActiveState, I got the same error on the same line, except this time it was for _csv.</p>
<p>To Quote from <a href="http://www.ironpython.info/index.php/Reading_CSV_Files" target="_blank">IronPython Cookbook</a> :</p>
<blockquote><p>For some reason the Python standard library <a class="external text" title="http://docs.python.org/lib/module-csv.html" href="http://docs.python.org/lib/module-csv.html">csv module</a> is written in C, which means that it isn&#8217;t available to IronPython.</p></blockquote>
<p>The cookbook points to a third party library called <a href="http://www.codeproject.com/KB/database/CsvReader.aspx" target="_blank">A Fast Csv Reader</a> . The cookbook has a nice example of how to use the said DLL with your IronPython Program.</p>
<p>It wasn&#8217;t clear to me as to why I had to register at Code Project to download this binary since it is provided under <a href="http://en.wikipedia.org/wiki/MIT_License" target="_blank">MIT Open Source License</a>. But whom am I gonna complain to ? Beggars can&#8217;t be choosers <img src='http://desipenguin.com/techblog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/97b6f3b5-f068-4b14-accd-9a79a802c586/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_b.png?x-id=97b6f3b5-f068-4b14-accd-9a79a802c586" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2009/07/03/reading-csv-files-in-ironpython/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IronPython</title>
		<link>http://desipenguin.com/techblog/2009/06/23/ironpython/</link>
		<comments>http://desipenguin.com/techblog/2009/06/23/ironpython/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 17:11:23 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[IronPython]]></category>
		<category><![CDATA[Microsoft Visual Studio]]></category>

		<guid isPermaLink="false">http://desipenguin.com/techblog/?p=288</guid>
		<description><![CDATA[



Image by Michael Foord via Flickr



After working on initial prototype using pylons, on ubuntu, my employer needed a standalone application (on windows) So I was looking for ways to reuse my python code to avoid double work.  had only heard about iron python but beyond that I did not know anything more.
A bit of research [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignleft" style="width: 138px;">
<dt class="wp-caption-dt"><a href="http://www.flickr.com/photos/13483019@N00/3225539390"><img title="IronPython in Action" src="http://farm4.static.flickr.com/3428/3225539390_e512d00174_m.jpg" alt="IronPython in Action" width="128" height="160" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image by <a href="http://www.flickr.com/photos/13483019@N00/3225539390">Michael Foord</a> via Flickr</dd>
</dl>
</div>
</div>
<p>After working on initial prototype using <a class="zem_slink" title="Pylons (web framework)" rel="homepage" href="http://www.pylonshq.com/">pylons</a>, on ubuntu, my employer needed a standalone application (on windows) So I was looking for ways to reuse my python code to avoid double work.  had only heard about iron python but beyond that I did not know anything more.</p>
<p>A bit of research later, I downloaded IronPython from <a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython" target="_blank">here</a> and<a href="http://www.codeplex.com/IronPythonStudio" target="_blank"> IronPython Studio</a>. I was quite thrilled to find out that Microsoft, has created this shell, which allows developers to integrate new languages with Visual Studio Shell.</p>
<h2>Installing IronPython Studio</h2>
<p>Installing IronPython was very straight forward. Considering it is one of the Python implementation itself, you don&#8217;t have to have standard python installed. (But I did, more on that later)</p>
<p>Setting up IronPython Studio wasn&#8217;t so straight forward.  I had to download standalone version of Visual Studio shell. But the problem, and it is well documented, is that installing the redistributable package in itself is not the complete step, as you would believe from the website. I confirmed that the package was installed, and stil IronPython Studio would complain, and refuse to proceed. It turns out that you need to install the Visual Studio environment, which is inside this directory structure you just created.</p>
<div id="attachment_290" class="wp-caption aligncenter" style="width: 613px"><img class="size-full wp-image-290" title="Visual Studio Redistributable Package " src="http://desipenguin.com/techblog/wp-content/uploads/2009/06/VS2K8-Isolated.JPG" alt="This is NOT enough" width="603" height="97" /><p class="wp-caption-text">This is NOT enough</p></div>
<div id="attachment_291" class="wp-caption aligncenter" style="width: 612px"><img class="size-full wp-image-291" title="Visual Studio Shell 2008" src="http://desipenguin.com/techblog/wp-content/uploads/2009/06/VS-Shell2K8.JPG" alt="This is what IronPython Studio needs" width="602" height="97" /><p class="wp-caption-text">This is what IronPython Studio needs</p></div>
<p>Once I installed Visual Studio Shell, IronPython Studio installed easily.  Using IronPython has been nice experience in just a few hours I have been using it. The Code completion isn&#8217;t upto my liking yet, but it is helpful at times.</p>
<h2>Using Standard Python Libraries</h2>
<p>Since my original code was written on linux, it used only the standard python modules. In a manner of speaking, it was &#8220;pure&#8221; python code. Since <em>IronPython is </em><span id="ctl00_ctl00_MasterContent_Content_wikiSourceLabel"><em>an implementation of the Python programming language running under .NET</em>, it was obivious that my code may not work as is. But I&#8217;m glad that I did not have to make too many changes to get it working under IronPython. </span></p>
<p><span>As is well documented in IronPython Tutorial, it is not very difficult to use standard python libraries with IronPython (with a few exceptions &#8211; more about this a little later) To get IronPython to use Standard Python Modules,  one needs to</span> add  the following two lines to <em>C:\IronPython-2.0.1\Lib\site.py</em> :</p>
<pre>import sys
sys.path.append(r"C:\Python25\Lib")</pre>
<p>While this works for most part, it doesn&#8217;t help if you are using Python extensions written in C. More about my specific problems  in another post. But there is an open source project <a href="http://code.google.com/p/ironclad/" target="_blank">IronClad</a> to deal specifically with this issue. In the meantime, you can check  <a href="http://ironpython.codeplex.com/Wiki/View.aspx?title=Differences" target="_blank">the differences between IronPython and CPython</a></p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 289px; width: 1px; height: 1px;">http://www.codeplex.com/IronPythonStudio</div>
<p><strong>Related articles</strong></p>
<ul>
<li><a href="http://blogs.msdn.com/hugunin/archive/2009/04/14/ironpython-in-action.aspx"> IronPython in Action </a> (blogs.msdn.com)</li>
<li><a href="http://www.mehmetalierturk.com/2009/05/04/why-python/"> Why Python? </a> (mehmetalierturk.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/d57dd1e2-9cff-474f-9b2e-8f575bf5d8b3/"><img class="zemanta-pixie-img" style="border: medium none ; float: right;" src="http://img.zemanta.com/reblog_b.png?x-id=d57dd1e2-9cff-474f-9b2e-8f575bf5d8b3" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2009/06/23/ironpython/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Access your todo list from multiple locations</title>
		<link>http://desipenguin.com/techblog/2009/01/17/access-your-todo-list-from-multiple-locations/</link>
		<comments>http://desipenguin.com/techblog/2009/01/17/access-your-todo-list-from-multiple-locations/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 01:17:06 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cross platform]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[mSys]]></category>

		<guid isPermaLink="false">http://desipenguin.wordpress.com/?p=135</guid>
		<description><![CDATA[Here is a clever method to access your todo list from multiple locations.
Ingredients

todo.sh &#8211; This is a command line shell scripts which allows to manage your TO DO list
DropBox Account : Free, Syncs various computers, Cross Platform (at least works on Windows as well as Linux)

Recipe

Make Sure you have installed Dropbox clients on all of [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a clever method to access your todo list from multiple locations.</p>
<h3>Ingredients</h3>
<ul>
<li><a href="http://todotxt.com/" target="_blank">todo.sh</a> &#8211; This is a command line shell scripts which allows to manage your TO DO list</li>
<li><a href="https://www.getdropbox.com/home" target="_blank">DropBox</a> Account : Free, Syncs various computers, Cross Platform (at least works on Windows as well as Linux)</li>
</ul>
<h3>Recipe</h3>
<ul>
<li>Make Sure you have installed Dropbox clients on all of your machines (Mainly Work and Home)</li>
<li>Download and install todo.sh in your Dropbox folder. This is main trick to make your TODO list portable.</li>
<li>You need to modify the .todo file (or todo.py script itself) to set the TODO_DIR variable. I&#8217;ve created a folder called &#8220;tododir&#8221; in my Dropbox folder, and set the TODO_DIR variable as &#8220;tododir&#8221;. This helps avoiding path problems on various machines.</li>
<li>(Optional) Read the tutorial available at <a href="http://lifehacker.com/software/top/geek-to-live--readerwritten-todotxt-manager-173018.php" target="_blank">LifeHacker</a></li>
<li>Open command Prompt, and take charge of your TODO lists.</li>
</ul>
<h3>Why This Idea Rocks</h3>
<ul>
<li>Since the todo list is maintained as simple text file, any machine/platform allows you to directly view and edit your todo list.</li>
<li>While one would install Dropbox clients on all of their regularly used machines, You can always view and edit your todo.txt even from a cyber cafe, using Dropbox&#8217;s web interface.</li>
</ul>
<h3>Are you on Windows ?</h3>
<ul>
<li>If you are on Windows, you will require <a href="http://www.cygwin.com/" target="_blank">cygwin </a>which provides unix utilities on windows. (I was unable to get todo.sh working with mSys, which I got as part of <a href="http://code.google.com/p/msysgit/downloads/list" target="_blank">mSys Git</a> (More about it later, in another post))</li>
<li>There is a variation of todo.sh written in Python (which is what I&#8217;m using these days). If which case, you need <a href="http://www.python.org/download/" target="_blank">Python </a>instead of Cygwin. Python version supports color coding of the items based on priority even on Windows.</li>
</ul>
<h3>Can I not just use USB Drive instead ?</h3>
<ul>
<li>Sure you can.  But some employers do not allow the employees to connect their personal USB devices to office computers. (Security, Virus threats) in which case Dropbox is better alternative.</li>
<li>Even Cyber cafe won&#8217;t allow to plug in your USB drive, but you sure can access your files from Web Front end of Dropbox.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2009/01/17/access-your-todo-list-from-multiple-locations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python : Fun with subprocess.stdin</title>
		<link>http://desipenguin.com/techblog/2009/01/13/fun-with-python-subprocessstdin/</link>
		<comments>http://desipenguin.com/techblog/2009/01/13/fun-with-python-subprocessstdin/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 06:38:08 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://desipenguin.wordpress.com/?p=129</guid>
		<description><![CDATA[As part of some automation work,  I needed to execute a program which requires each command to be explictely validated by the user by expliciltely selecting &#8220;y&#8221; or &#8220;n&#8221; , on the command line. Since I was processing a large number of files, I decided to use python script.
I used the subprocess module of python [...]]]></description>
			<content:encoded><![CDATA[<p>As part of some automation work,  I needed to execute a program which requires each command to be explictely validated by the user by expliciltely selecting &#8220;y&#8221; or &#8220;n&#8221; , on the command line. Since I was processing a large number of files, I decided to use python script.</p>
<p>I used the subprocess module of python to invoke the external program. It was easy to capture the output sent on stdout. In order to send &#8216;<em>y</em>&#8216; on stdin for each iteration,  I tried sending &#8216;<em>y</em>&#8216; on stdin, but that would not work.  The script would hang. After discussing this, with more experienced python programmer, it was suggested that one possible reason why the script hangs is may be because the stdin buffer wasn&#8217;t <em>flushed</em>.  Both of us were not sure how to do that. Then it was discussed that when we run the external program from command line, we not only type &#8216;<em>y</em>&#8216; as response, but we also hit <em>Enter </em>there after, which results in <em>flushing </em>the stdin buffer. So may be that is what I ought to try.</p>
<p>To my surprise, it worked. So the solution was to pass &#8216;<em>y/n</em>&#8216; instead of single &#8216;<em>y</em>&#8216;</p>
<p>Here is how my code looked like :<br />
<code><br />
import subprocess<br />
cmd = "...." # The command you wish to execute<br />
proc = subprocess.Popen(cmd,<br />
                       stdin=subprocess.PIPE,<br />
                       stdout=subprocess.PIPE)<br />
print proc.communicate('Y\n')[0]<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2009/01/13/fun-with-python-subprocessstdin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
