<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

  <channel>
    <title>vsbabu.org : python</title>
    <link>http://vsbabu.org/mt/archives/categories/python/</link>
    <description>Gluing passing thoughts to foregone conclusions</description>
    <dc:language>en-us</dc:language>
    <dc:creator>vsbabu@gmail.com</dc:creator>
    <dc:rights>Copyright 2009</dc:rights>
    <dc:date>2009-08-26T13:15:59+05:00</dc:date>
    <admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=2.661" />
    <admin:errorReportsTo rdf:resource="mailto:vsbabu@gmail.com"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>

    <item>
      <title>India PyCon 2009</title>
      <link>http://vsbabu.org/mt/archives/2009/08/26/india_pycon_2009.html</link>
      <description>PyCon in Bangalore</description>
      <guid isPermaLink="false">1049@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p><img alt="pyconin2009.gif" src="http://vsbabu.org/mt/archives/images/pyconin2009.gif" width="179" height="213" border="0" style="margin:2px 2px 2px 2px;" align="right"/> Got an email from <a href="http://nibrahim.net.in/">one of my fellow</a> REC/NIT guys. <a href="http://in.pycon.org/2009">PyCon 2009 India</a> is underway next month. IISc is a must-visit place for any Engineer in India, in my opinion. Pythonistas who are not in India - here is your chance to couple tourism with Python :-)
</p>

<p>
I've some outstation trips planned during this time frame - if that doesn't happen, I am going to be there.
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2009-08-26T13:15:59+05:00</dc:date>
    </item>
    <item>
      <title>Quick wallpaper changer</title>
      <link>http://vsbabu.org/mt/archives/2009/08/24/quick_wallpaper_changer.html</link>
      <description>Silly python. Change wallpaper.</description>
      <guid isPermaLink="false">1047@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
There are a whole bunch of fancy wallpaper changers for Windows<sup>TM</sup> out there. Most of them run in the background - and I am wary of background processes. Since I use <a href="http://bb4win.sourceforge.net/bblean">bblean</a>, and bblean (or equivalently, blackbox/fluxbox etc on Linux) comes with utilities like bsetroot that can set the wallpaper; it was a simple matter to whip up a silly Python script that picks up a random image file from a directory and call bsetroot. Put this as a Windows<sup>TM</sup> scheduled task to run every 10 minutes or so. 
</p>

<p>
Don't you love Python's list functions? 
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2009-08-24T19:31:38+05:00</dc:date>
    </item>
    <item>
      <title>Load testing with Grinder</title>
      <link>http://vsbabu.org/mt/archives/2009/08/24/load_testing_with_grinder.html</link>
      <description>Been playing with Grinder. Very nice.</description>
      <guid isPermaLink="false">1046@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p><a href="http://grinder.sourceforge.net/">Grinder</a> rocks. Made it so easy to
  setup load testing framework for Web Applications. While it certainly helped that I had
  worked with <a href="http://www.python.org/">Python</a> before, it took hardly 2-3 days
  to:</p>

  <ul>
    <li>understand the framework (could've been faster, if I had RTFM)</li>

    <li>write my own scripts</li>

    <li>understand how the recorded scripts are structured</li>

    <li>extract relevant parts from recorded scripts to my test scripts</li>

    <li>train couple of folks on how to do this on their own</li>

    <li>and test our application's UI</li>
  </ul>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2009-08-24T09:00:31+05:00</dc:date>
    </item>
    <item>
      <title>Adding  namespace to XML</title>
      <link>http://vsbabu.org/mt/archives/2009/08/23/adding_namespace_to_xml.html</link>
      <description>Regex on XML to add a namespace</description>
      <guid isPermaLink="false">1045@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>InfoPath expects a namespace to be defined in the XML. In case you've done custom web services that don't have the heavy payload of SOAP, you might've skipped on namespace too.  I ran into this issue recently - it is easy enough to front end your web service with a small regex script that attaches a namespace. Here is a small python regex snippet that adds a namespace named my: to an XML.
</p>
]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2009-08-23T14:04:16+05:00</dc:date>
    </item>
    <item>
      <title>Opera RSS to OPML</title>
      <link>http://vsbabu.org/mt/archives/2005/07/03/opera_rss_to_opml.html</link>
      <description>Small Python script to generate OPML from Opera&apos;s RSS feed list.</description>
      <guid isPermaLink="false">1008@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
I really like <a href="http://www.opera.com/">Opera</a> 8 quite a lot. It has nice integrated RSS + E-mail + NNTP reader. But one thing I found missing was ability to export my feed list. Since most RSS readers read OPML format these days, here is a Python snippet to help you export Opera feeds settings. I have tested this on my machine and my feeds. Your mileage may vary - feel free to modify this.
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2005-07-03T21:18:36+05:00</dc:date>
    </item>
    <item>
      <title>Soup is beautiful</title>
      <link>http://vsbabu.org/mt/archives/2005/03/23/soup_is_beautiful.html</link>
      <description>Came across BeautifulSoup yesterday. Very nice!</description>
      <guid isPermaLink="false">999@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
<a href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> is a great Python module that lets you
parse HTML and XML documents very easily. Via <a href="http://www.swaroopch.info/archives/2005/03/20/march-meet-of-bangpypers/">BangPypers meeting note</a>.
</p>

]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2005-03-23T12:26:37+05:00</dc:date>
    </item>
    <item>
      <title>Using Leo with reST</title>
      <link>http://vsbabu.org/mt/archives/2005/01/22/using_leo_with_rest.html</link>
      <description>Follow up on the older entry; things have changed with Leo 4.2 final.</description>
      <guid isPermaLink="false">996@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
For background infromation for this post, see <a href="http://vsbabu.org/mt/archives/2003/06/02/using_leo_for_rest.html">my original post in 2003</a>. I had to spend some time to get reST going with Leo 4.2. Now there are two plugins for reST., viz., old plugin and a new plugin called rst2 for getting
reST formatted documentation for source code.
</p>

<p>
Here's how you can use old reST plugin to keep your documentation work easy and organized.
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2005-01-22T10:32:35+05:00</dc:date>
    </item>
    <item>
      <title>Jython is great</title>
      <link>http://vsbabu.org/mt/archives/2004/02/24/jython_is_great.html</link>
      <description>Long overdue note on the ease and elegance of Jython.</description>
      <guid isPermaLink="false">981@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
    <a href="http://www.jython.org/">Jython</a> is a great time saver. It is a small
    download and installation is a very easy. It actually makes Java a bit more
    pleasing.
</p>

<p>
    Some quick uses I've found so far include:
</p>

<ol>
    <li>Making quick test scripts to integrate different Java components.</li>
    <li>Adding such scripts write into an Ant task.</li>
    <li>Using the great <a href="http://vsbabu.org/mt/archives/2003/02/13/joy_of_python_dir_help_and_pprint.html">pprint and dir</a>
        functions to dive into Java classes and methods much faster than API documentation.</li>
</ol>

<p>
    I am sure there are many more ways Jython can be used. For example, I checked in one old script
    that took about 15 minutes to write -- it provides a <a href="http://vsbabu.org/tmp/jyqlp.jy">rudimentary interactive sql shell</a>.
    The code couldn't be simpler! A while back, I needed to access an Oracle database. SQL*Plus
    was not installed in the client machine and the installer was not available either. This script
    came in handy then.
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2004-02-24T12:13:48+05:00</dc:date>
    </item>
    <item>
      <title>Quick UI for DocIndexer</title>
      <link>http://vsbabu.org/mt/archives/2003/12/23/quick_ui_for_docindexer.html</link>
      <description>Simple UI for a great utility that _just works_ using LuPy.</description>
      <guid isPermaLink="false">954@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<blockquote><a href="http://www.methods.co.nz/docindexer/">DocIndexer</a> is a toolkit for indexing and searching document directories. DocIndexer includes command-line utilities, Python file index and search classes plus a Win32 COM server (for scripting from languages such as Visual Basic) which can be used to integrate indexing and searching into application software. The current version has built-in support for Microsoft Word, HTML, RTF, PDF and plain text documents.
</blockquote>

<p>
Once the indexing is done, the search is very fast. I used it for 2 days and already can't live without it.  The search results come up in a DOS window; which makes it difficult to actually pull up documents from the search results (Mark - Copy - Paste).
</p>

<p>
So, I wrote a  <a href="http://vsbabu.org/tools/viewcvs.cgi/DocIndexerUI/">quick HTA to act as a front end</a>  for <tt>docsearch.exe</tt>.  Obligatory screen shot is below.
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2003-12-23T12:47:27+05:00</dc:date>
    </item>
    <item>
      <title>Scrape &apos;em!</title>
      <link>http://vsbabu.org/mt/archives/2003/10/23/scrape_em.html</link>
      <description>One of those moments where &quot;scripting&quot; is better than compiled languages:-)</description>
      <guid isPermaLink="false">926@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
I wanted to prove a point about the value of less number of lines of code to get
something done. I also wanted to prove a point about readability of code too.
</p>

<p>
Python code is below. Naturally, the other option is to  finish up semi-colons, braces  and compilation in that
<a href="http://vsbabu.org/tools/viewcvs.cgi/OnJavaComArticles.java?rev=HEAD&cvsroot=Java&content-type=text/vnd.viewcvs-markup" title="similar code">other 
language</a>.
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2003-10-23T13:02:46+05:00</dc:date>
    </item>
    <item>
      <title>Regex HTML extraction examples</title>
      <link>http://vsbabu.org/mt/archives/2003/09/18/regex_html_extraction_examples.html</link>
      <description>Couple of examples to parse web pages with news items.</description>
      <guid isPermaLink="false">893@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
Every other week, I find myself  facing a job requiring regular expressions.
And every other week, I need to refer to  <a href="http://www.python.org/doc/current/lib/module-re.html">python re module </a> and <a href="http://www.amk.ca/python/howto/regex/">regex howto</a>.
</p>

<p>
In an effort to reduce that time, here is <a href="http://vsbabu.org/tools/viewcvs.cgi/parse_news_html.py?rev=HEAD&content-type=text/vnd.viewcvs-markup">working code</a> that -- at the moment --  parses <a href="http://news.nationalgeographic.com/news/ngchannel.html">National Geographic News</a> and <a href="http://www-106.ibm.com/developerworks/">IBM dW home page</a>. Perhaps it might be useful to newbies too. The functions return a list of tuples like <code>(title, url, description, date, category)</code>
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2003-09-18T09:08:38+05:00</dc:date>
    </item>
    <item>
      <title>Interactive Python - notes</title>
      <link>http://vsbabu.org/mt/archives/2003/09/16/interactive_python_notes.html</link>
      <description>Additional notes on what I like about Python&apos;s interactive interpreter.</description>
      <guid isPermaLink="false">891@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
<a href="http://simon.incutio.com/">Simon Willison</a> has a great
example, <a href="http://simon.incutio.com/archive/2003/09/15/interactivePython">explaining
Python's interactive interpreter</a>. I agree with Simon on how useful it is for rapid application development, by seeing results for each line, right there.
</p>

<p>
A really great feature is the <code>-i</code> option.
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2003-09-16T06:21:04+05:00</dc:date>
    </item>
    <item>
      <title>Jython zxJDBC rocks!</title>
      <link>http://vsbabu.org/mt/archives/2003/09/15/jython_zxjdbc_rocks.html</link>
      <description>Jython with zxJDBC makes life so much easier for data maintenance scripts.</description>
      <guid isPermaLink="false">890@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
I usually use <a href="http://www.computronix.com/utilities.shtml#Oracle">cxOracle</a> from Python for accessing Oracle. Today,
I tried using <a href="http://www.jython.org/">Jython</a>. It is as easy as using CPython. 
</p>

<p>
I really liked  <a href="http://www.jython.org/docs/zxjdbc.html"><code>zxJDBC</code></a>.
Especially the <code>dbexts</code> wrapper - makes it much easier
to write portable code by moving DB parameters to a configuration file.
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2003-09-15T18:05:12+05:00</dc:date>
    </item>
    <item>
      <title>Updates to feeds</title>
      <link>http://vsbabu.org/mt/archives/2003/09/14/updates_to_feeds.html</link>
      <description>Feed on feeds get categorization and opml.</description>
      <guid isPermaLink="false">888@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>
<a href="http://spycyroll.sourceforge.net/">Spycyroll</a> has been
pretty much dead after arrival :-) Today, I got some time to mess
with the source to add quick templating using <a href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/162292">XYAPTU</a>.
I need to figure out how to check it in - now, the code is a collection
of Python and shell scripts (some things are just too easy in Shell).
</p>

<p>
Summary of results are below.
</p>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2003-09-14T11:17:39+05:00</dc:date>
    </item>
    <item>
      <title>Python 2.3</title>
      <link>http://vsbabu.org/mt/archives/2003/09/12/python_23.html</link>
      <description>What&apos;s new in Python 2.3? Coverage in Byte.com.</description>
      <guid isPermaLink="false">885@http://vsbabu.org/mt/</guid>
      <content:encoded><![CDATA[<p>I love these new features. Read <a href="http://www.byte.com/documents/s=8880/byt1062182129207/">the full article at Byte.com</a></p>

<ul><li>Pure Python implementation of strptime()</li>
<li>Better datetime!  _print &#8221;%d days between dates&#8221; % (date1 - date2).days_</li>
<li><span class="caps">CSV</span> module</li>
<li>Better logging module</li>
<li><span class="caps">A </span><em>sets</em> module. Wow!</li>
<li>Another great built-in function - _for i, word in enumerate(words):_</li>
<li>Slicing for sequence types get an optional &#8220;stride&#8221;.</li>
</ul>]]></content:encoded>
      <dc:subject>python</dc:subject>
      <dc:date>2003-09-12T11:37:47+05:00</dc:date>
    </item>


  </channel>
</rss>


