<?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>Brian Lyttle &#187; python</title>
	<atom:link href="http://brianlyttle.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://brianlyttle.com</link>
	<description>What happens when the code just stops</description>
	<lastBuildDate>Sat, 20 Mar 2010 17:59:23 +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>Looking forward to PyCon 2010!</title>
		<link>http://brianlyttle.com/2010/02/looking-forward-to-pycon-2010/</link>
		<comments>http://brianlyttle.com/2010/02/looking-forward-to-pycon-2010/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 05:04:29 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[atlanta]]></category>
		<category><![CDATA[pycon]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://brianlyttle.com/?p=182</guid>
		<description><![CDATA[On Thursday I&#8217;m making the yearly pilgrimage to PyCon in Atlanta. This will be my third year and I&#8217;m sure it&#8217;ll be better than ever. 
For me the real highlights of this conference are the legendary open space sessions. The level of interaction and learning at these really sets it apart from other conferences. Last [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>On Thursday I&#8217;m making the yearly pilgrimage to <a href="http://us.pycon.org/2010/about/">PyCon in Atlanta</a>. This will be my third year and I&#8217;m sure it&#8217;ll be better than ever. </p>
<p>For me the real highlights of this conference are the legendary open space sessions. The level of interaction and learning at these really sets it apart from other conferences. Last year I attended a number of crackers including one on <a href="http://incubator.apache.org/cassandra/">Cassandra</a> and big data scalability with <a href="http://spyced.blogspot.com/">Jonathan Ellis</a>. It&#8217;s great to see that Jonathan is delivering a <a href="http://us.pycon.org/2010/conference/schedule/event/28/">scheduled talk on database scalability</a>, and I&#8217;m sure there will be a fair number of open space sessions dedicated to NoSQL databases.</p>
<p>Looking at the <a href="http://us.pycon.org/2010/conference/schedule/">2010 schedule</a> these are my other top picks:</p>
<ol>
<li><a href="http://us.pycon.org/2010/conference/schedule/event/19/">Deployment, development, packaging, and a little bit of the cloud</a> (Ian Bicking)</li>
<li><a href="http://us.pycon.org/2010/conference/schedule/event/47/">Powerful Pythonic Patterns</a> (Alex Martelli)</li>
<li><a href="http://us.pycon.org/2010/conference/schedule/event/76/">Understanding the Python GIL</a> (David Beazley)</li>
<li><a href="http://us.pycon.org/2010/conference/schedule/event/86/">Mastering Team Play: Four powerful examples of composing Python tools</a> (Raymond Hettinger)</li>
<li><a href="http://us.pycon.org/2010/conference/schedule/event/71/">Unladen Swallow: fewer coconuts, faster Python</a> (Collin Winter)</li>
</ol>
<p>I&#8217;ll have my camera with me again this year so watch out for pics under the pycon and pycon2010 tags on Flickr.</p>
]]></content:encoded>
			<wfw:commentRss>http://brianlyttle.com/2010/02/looking-forward-to-pycon-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter to blog script</title>
		<link>http://brianlyttle.com/2009/05/twitter-to-blog-script/</link>
		<comments>http://brianlyttle.com/2009/05/twitter-to-blog-script/#comments</comments>
		<pubDate>Sun, 24 May 2009 17:37:58 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://brianlyttle.com/?p=147</guid>
		<description><![CDATA[Based on an example provided with the Twitter library for Python I cobbled together the following script to add my latest tweets to this site. It&#8217;s called from a cron job that I run on an occasional basis. My script linkifies hashtags and @username tokens in tweets so that you can see search results or [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img src="/wp-content/uploads/2009/05/twitter_logo_header.png" alt="Twitter logo" class="imgright" />Based on <a href="http://code.google.com/p/python-twitter/source/browse/trunk/examples/twitter-to-xhtml.py">an example</a> provided with the <a href="http://code.google.com/p/python-twitter/">Twitter library for Python</a> I cobbled together the following script to add my latest tweets to this site. It&#8217;s called from a cron job that I run on an occasional basis. My script linkifies hashtags and @username tokens in tweets so that you can see search results or user information.</p>
<p>Why did I not use one of the WordPress widgets? Well writing scripts like this is fun, and some widgets don&#8217;t seem to play too well with my Thesis theme. One thing to note is that getting the shell script setup under some cron configurations can take a while if you aren&#8217;t using it on a regular basis. It&#8217;s operation is also different between Ubuntu Server and Joyent&#8217;s Accelerator platform.</p>
<p>Up next: a similar script to process my latest bookmarks on <a href="http://delicious.com/brianly">Delicious.com</a>.</p>
<p><strong>Main script (tweets.py)</strong></p>
<pre>
#!/usr/bin/python

import codecs, re, getopt, sys, twitter

TEMPLATE = &quot;&quot;&quot;
&lt;li&gt;
  &lt;span class=&quot;twitter-text&quot;&gt;%s&lt;/span&gt;
  &lt;span class=&quot;twitter-relative-created-at&quot;&gt;&lt;a href=&quot;http://twitter.com/%s/statuses/%s&quot;&gt;Posted %s&lt;/a&gt;&lt;/span&gt;
&lt;/li&gt;
&quot;&quot;&quot;

def Usage():
  print 'Usage: %s [options] twitterid' % __file__
  print
  print '  This script fetches a users latest twitter update and stores'
  print '  the result in a file as an XHTML fragment'
  print
  print '  Options:'
  print '    --help -h : print this help'
  print '    --output : the output file [default: stdout]'

def FetchTwitter(user, output):
  assert user
  statuses = twitter.Api().GetUserTimeline(user=user, count=7)

  xhtml = []
  for status in statuses:
  	  status.text = Linkify(status.text)
  	  xhtml.append(TEMPLATE % (status.text, status.user.screen_name, status.id, status.relative_created_at))

  if output:
    Save(''.join(xhtml), output)
  else:
    print ''.join(xhtml)

def Linkify(tweet):
    tweet = re.sub(r'(\A|\s)@(\w+)', r'\1@<a href="http://www.twitter.com/\2">\2</a>', tweet)
    return re.sub(r'(\A|\s)#(\w+)', r'\1#<a href="http://search.twitter.com/search?q=%23\2">\2</a>', tweet)

def Save(xhtml, output):
  out = codecs.open(output, mode='w', encoding='utf-8',
                    errors='xmlcharrefreplace')
  out.write(xhtml)
  out.close()

def main():
  try:
    opts, args = getopt.gnu_getopt(sys.argv[1:], 'ho', ['help', 'output='])
  except getopt.GetoptError:
    Usage()
    sys.exit(2)
  try:
    user = args[0]
  except:
    Usage()
    sys.exit(2)
  output = None
  for o, a in opts:
    if o in ("-h", "--help"):
      Usage()
      sys.exit(2)
    if o in ("-o", "--output"):
      output = a
  FetchTwitter(user, output)

if __name__ == "__main__":
  main()
</pre>
<p><strong>Shell script executed as cron job (tweets.sh)</strong></p>
<pre>
/usr/bin/python /path/to/tweets.py brianly --output /path/to/output/twittertimeline.htm
</pre>
]]></content:encoded>
			<wfw:commentRss>http://brianlyttle.com/2009/05/twitter-to-blog-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekly Links #2</title>
		<link>http://brianlyttle.com/2009/01/weekly-links-2/</link>
		<comments>http://brianlyttle.com/2009/01/weekly-links-2/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 04:18:12 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Bookmarks]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[retlang]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://brianlyttle.com/?p=66</guid>
		<description><![CDATA[
Microsoft InfoMesa Project Whiteboard for your data
Fabric &#8211; like Capistrano but written in Python
A Visual Introduction to Screen
retlang &#8211; Google Code
Tim Sneath : The Bumper List of Windows 7 Secrets
update-engine &#8211; Google Code

]]></description>
			<content:encoded><![CDATA[<p></p><ul>
<li><a href="http://blogs.msdn.com/dan_fay/archive/2008/12/09/infomesa-project-whiteboard-for-your-data.aspx">Microsoft InfoMesa Project Whiteboard for your data</a></li>
<li><a href="http://www.nongnu.org/fab/">Fabric &#8211; like Capistrano but written in Python</a></li>
<li><a href="http://blogamundo.net/code/screen/">A Visual Introduction to Screen</a></li>
<li><a href="http://code.google.com/p/retlang/">retlang &#8211; Google Code</a></li>
<li><a href="http://blogs.msdn.com/tims/archive/2009/01/12/the-bumper-list-of-windows-7-secrets.aspx">Tim Sneath : The Bumper List of Windows 7 Secrets</a></li>
<li><a href="http://code.google.com/p/update-engine/">update-engine &#8211; Google Code</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://brianlyttle.com/2009/01/weekly-links-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
