<?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>/home/shakir &#187; shell</title>
	<atom:link href="http://www.mohdshakir.net/tag/shell/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mohdshakir.net</link>
	<description>My Piece Of The Web</description>
	<lastBuildDate>Fri, 16 Jul 2010 15:45:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Interactive Python shell with IPython</title>
		<link>http://www.mohdshakir.net/2007/12/15/interactive-python-shell-with-ipython</link>
		<comments>http://www.mohdshakir.net/2007/12/15/interactive-python-shell-with-ipython#comments</comments>
		<pubDate>Sat, 15 Dec 2007 04:48:04 +0000</pubDate>
		<dc:creator>shakir</dc:creator>
				<category><![CDATA[Information Insemination]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.mohdshakir.net/2007/12/15/interactive-python-shell-with-ipython</guid>
		<description><![CDATA[One nice thing about Python as compared to some other scripting languages, is that it has a shell that enables us to test our Python script on the fly without needing to write a script file first It&#8217;s nice and all that, but when you&#8217;re too used to IDEs which has features such as auto [...]]]></description>
			<content:encoded><![CDATA[<p>One nice thing about Python as compared to some other scripting languages, is that it has a shell that enables us to test our Python script on the fly without needing to write a script file first</p>
<p>It&#8217;s nice and all that, but when you&#8217;re too used to IDEs which has features such as auto completion etcetera, you&#8217;ll feel like something is not right about the default python shell.</p>
<p>That changes when I come to IPython, one of the few other enhanced Python shell. The one feature I like most is the auto complete feature, which among other by using it I don&#8217;t need to remember module names, and at the same time would list and try Python modules that I&#8217;ve never heard of.</p>
<p>In Ubuntu, or debian in general, the package is called ipython, and to install it just;</p>
<pre>shakir@herugrim ~ $ sudo apt-get install ipython</pre>
<p>Can you spot the differences between this</p>
<pre>
shakir@herugrim ~ $ python
Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import command
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named command
>>> import commands
>>> status, output = commands.getoutputstatus ('ls')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getoutputstatus'
>>> status, output = commands.getstatusoutput ('ls')
>>> print output
Desktop
Documents
Music
Photos
>>>
shakir@herugrim ~ $
</pre>
<p>and this?</p>
<pre>
shakir@herugrim ~ $ ipython
Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32)
Type "copyright", "credits" or "license" for more information.

IPython 0.8.1 -- An enhanced Interactive Python.
?       -> Introduction to IPython's features.
%magic  -> Information about IPython's 'magic' % functions.
help    -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import command
---------------------------------------------------------------------------
<type 'exceptions.ImportError'>           Traceback (most recent call last)

/home/shakir/<ipython console> in <module>()

<type 'exceptions.ImportError'>: No module named command

In [2]: import commands

In [3]: status, output = commands.
commands.__all__           commands.__hash__          commands.__setattr__
commands.__class__         commands.__init__          commands.__str__
commands.__delattr__       commands.__name__          commands.getoutput
commands.__dict__          commands.__new__           commands.getstatus
commands.__doc__           commands.__reduce__        commands.getstatusoutput
commands.__file__          commands.__reduce_ex__     commands.mk2arg
commands.__getattribute__  commands.__repr__          commands.mkarg

In [3]: status, output = commands.gets
commands.getstatus        commands.getstatusoutput

In [3]: status, output = commands.getstatusoutput('ls')

In [4]: print output
Desktop
Documents
Music
Photos

In [5]:
Do you really want to exit ([y]/n)? y
shakir@herugrim ~ $
</pre>
<p>I hope you can guess when did I press the [tab] key <img src='http://www.mohdshakir.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mohdshakir.net/2007/12/15/interactive-python-shell-with-ipython/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
