December 21, 2004

Python.Net Productivity

Python is a productivity booster. The .NET Framework is a productivity booster. It's amazing how productive you can be with Python.NET. from CLR.System.Xml import XmlDocument
from urllib2 import urlopen
import sys

def showEntries(feedUrl):
"""Lists the titles of rss items contained in the feed at the given url.""" fp = urlopen(feedUrl) rss = fp.read() fp.close()
doc = XmlDocument() doc.LoadXml(rss)
nodes = doc.SelectNodes("//item/title") for node in nodes: print node.InnerText
if __name__ == "__main__":
showEntries(sys.argv[1])
Posted by Christian at December 21, 2004 11:44 AM |
Comments
Post a comment