<?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>Transneptune &#187; python</title>
	<atom:link href="http://transneptune.net/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://transneptune.net</link>
	<description>beyond the Kuiper Belt, over the sea</description>
	<lastBuildDate>Thu, 10 May 2012 06:24:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>iPython as your default shell</title>
		<link>http://transneptune.net/2009/06/16/ipython-as-your-default-shell/</link>
		<comments>http://transneptune.net/2009/06/16/ipython-as-your-default-shell/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 00:12:32 +0000</pubDate>
		<dc:creator>Kit</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[ipython]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://transneptune.net/?p=175</guid>
		<description><![CDATA[At the request of Ultranurd, allow me to explain my new shell set up. I&#8217;m sick of bash.  The syntax is absurd, and absurd syntax makes me sad. So I&#8217;ve just recently set up iPython as my shell. What follows are the relevant config files and some explanation. First, we want to make sure that [...]]]></description>
			<content:encoded><![CDATA[<p>At the request of <a title="UltraNurdage" href="http://blog.ultranurd.net/">Ultranurd</a>, allow me to explain my new shell set up.</p>
<p>I&#8217;m sick of <code>bash</code>.  The syntax is absurd, and absurd syntax makes me sad.  So I&#8217;ve just recently set up <a href="http://ipython.scipy.org">iPython</a> as my shell.  What follows are the relevant config files and some explanation.<span id="more-175"></span></p>
<p>First, we want to make sure that iPython is installed, and if we&#8217;re on OS X, that it&#8217;s installed for Python 2.6.  The reason for this is that earlier versions of Python don&#8217;t handle tab completion and command line history well—by using <code>libedit</code> rather than <code>readline</code> proper, they have some bugs that make things still strictly speaking <em>functional</em>, but hardly visually appealing.  You&#8217;ll have to trust me, as I don&#8217;t want to find the words to explain the ways it looks bad.</p>
<p>So, for OS X, download Python 2.6, install it, and download the latest stable source for iPython and install it with Python 2.6.  Something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">curl http:<span style="color: #000000; font-weight: bold;">//</span>www.python.org<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span>python<span style="color: #000000; font-weight: bold;">/</span>2.6.2<span style="color: #000000; font-weight: bold;">/</span>python-2.6.2-macosx2009-04-<span style="color: #000000;">16</span>.dmg <span style="color: #660033;">-o</span> python-2.6.2-macosx2009-04-<span style="color: #000000;">16</span>.dmg
open python-2.6.2-macosx2009-04-<span style="color: #000000;">16</span>.dmg
<span style="color: #666666; font-style: italic;"># do the installer dance</span>
curl http:<span style="color: #000000; font-weight: bold;">//</span>ipython.scipy.org<span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/</span>ipython-0.9.1.tar.gz <span style="color: #660033;">-o</span> ipython-0.9.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzvf</span> ipython-0.9.1.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> ipython-0.9.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Now, to make sure it&#8217;s working, run <code>ipython</code> and you should see <code>Python <strong>2.6.2</strong> (r262:71600, Apr 16 2009, 09:17:39)</code> or something like it as the first line.  The key part is the <code><strong>2.6.2</strong></code>.</p>
<p>Now, to make this your shell.  The Proper Right and True way would involve <code>chsh</code>, but because I like to sync my homedir configurations across many systems I operate on, I&#8217;ve done it the Immoral Bad and Evil way, by just appending <code>exec /usr/local/bin/ipython -noconfirm_exit -p sh</code> to my <code>.bashrc</code>.</p>
<p>Let me unpack that line.  <code>exec</code> is a <code>bash</code> builtin that executes a command, replacing <code>bash</code> with that command.  <code>/usr/local/bin/ipython</code> is just a fully qualified path to <code>ipython</code>; ymmv.  <code>-noconfirm_exit</code> gets rid of the &#8220;are you sure you want to quit?&#8221; on ctrl-D, which I find annoying.  Again, ymmv.  Most importantly, there&#8217;s <code>-p sh</code>.  Dark secret, I actually have <code>-p kit</code>, which loads a custom profile called <code>kit</code>.  But the idea is the same, and that profile is based off of the builtin <code>sh</code> profile.  I won&#8217;t go in to making a custom profile here; start with <code>sh</code> and play around with it.</p>
<p>Save the relevant files, open a new terminal just to make sure nothing&#8217;s borked (leaving your old terminal still open!).  You should see something like</p>
<pre>
Last login: Tue Jun 16 18:01:54 on ttys000
IPython 0.9.1   [on Py 2.6.2]
kit@morgana[~]&gt;
</pre>
<p>Now, you can pretty freely mix Python and shell commands.  If you need to escape something to be shell-y, and make sure it doesn&#8217;t get pythonized, just prepend a <code>!</code>.  Enjoy.  Comment with questions; I&#8217;ll elaborate.</p>
]]></content:encoded>
			<wfw:commentRss>http://transneptune.net/2009/06/16/ipython-as-your-default-shell/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Jabber Bot</title>
		<link>http://transneptune.net/2009/05/10/jabber-bot/</link>
		<comments>http://transneptune.net/2009/05/10/jabber-bot/#comments</comments>
		<pubDate>Sun, 10 May 2009 06:29:32 +0000</pubDate>
		<dc:creator>Kit</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[jabber]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://transneptune.net/?p=138</guid>
		<description><![CDATA[So, I&#8217;ve written a python-based MUC-aware Jabber bot framework, using XMPPpy.  If anyone would be interested in using or improving this, please let me know.  I want it to be of use to people, like a Jabbery version of your IRC-bot framework of choice.  It is currently instantiated only as Tyche, my dicerolling bot for [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve written a python-based <acronym title="Multi-User Chat">MUC</acronym>-aware Jabber bot framework, using <acronym title="eXtensible Messaging and Presence Protocol">XMPP</acronym>py.  If anyone would be interested in using or improving this, please let me know.  I want it to be of use to people, like a Jabbery version of your <acronym title="Internet Relay Chat">IRC</acronym>-bot framework of choice.  It is currently instantiated only as Tyche, my dicerolling bot for tabletop <acronym title="Role-Playing Game">RPG</acronym>s online (who also provides some snark when people are predictable in the gaming rooms).  But the more uses it finds, the moar betterer it gets, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://transneptune.net/2009/05/10/jabber-bot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

