<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Python%2FC2%2FGetting-started-with-ipython%2FEnglish</id>
		<title>Python/C2/Getting-started-with-ipython/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Python%2FC2%2FGetting-started-with-ipython%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python/C2/Getting-started-with-ipython/English&amp;action=history"/>
		<updated>2026-04-08T19:59:09Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Python/C2/Getting-started-with-ipython/English&amp;diff=926&amp;oldid=prev</id>
		<title>Pravin1389: moved Python/C2/Getting-started-with-ipython /English to Python/C2/Getting-started-with-ipython/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python/C2/Getting-started-with-ipython/English&amp;diff=926&amp;oldid=prev"/>
				<updated>2012-12-02T06:23:28Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/index.php/Python/C2/Getting-started-with-ipython_/English&quot; class=&quot;mw-redirect&quot; title=&quot;Python/C2/Getting-started-with-ipython /English&quot;&gt;Python/C2/Getting-started-with-ipython /English&lt;/a&gt; to &lt;a href=&quot;/index.php/Python/C2/Getting-started-with-ipython/English&quot; title=&quot;Python/C2/Getting-started-with-ipython/English&quot;&gt;Python/C2/Getting-started-with-ipython/English&lt;/a&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 06:23, 2 December 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Pravin1389</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Python/C2/Getting-started-with-ipython/English&amp;diff=441&amp;oldid=prev</id>
		<title>Chandrika: Created page with '{| border=1 !Visual Cue !Narration |- | Show slide 1   Title Slide  | Hello Friends and Welcome to the tutorial on &quot;getting started with &lt;tt&gt;ipython&lt;/tt&gt;&quot;.  |- | Show slide 2   L…'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Python/C2/Getting-started-with-ipython/English&amp;diff=441&amp;oldid=prev"/>
				<updated>2012-11-29T05:53:40Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;{| border=1 !Visual Cue !Narration |- | Show slide 1   Title Slide  | Hello Friends and Welcome to the tutorial on &amp;quot;getting started with &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt;&amp;quot;.  |- | Show slide 2   L…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| border=1&lt;br /&gt;
!Visual Cue&lt;br /&gt;
!Narration&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 1 &lt;br /&gt;
&lt;br /&gt;
Title Slide &lt;br /&gt;
| Hello Friends and Welcome to the tutorial on &amp;quot;getting started with &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 2 &lt;br /&gt;
&lt;br /&gt;
Learning objectives &lt;br /&gt;
| At the end of this tutorial, you will be able to,&lt;br /&gt;
&lt;br /&gt;
# invoke the &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt; interpreter .&lt;br /&gt;
# quit the &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt; interpreter.&lt;br /&gt;
# navigate the &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt; session history.&lt;br /&gt;
# use tab-completion for writing ipython functions.&lt;br /&gt;
# look-up documentation of functions.&lt;br /&gt;
# interrupt incomplete or incorrect commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  ipython&lt;br /&gt;
| IPython is an enhanced Python interpreter that provides features like tab-completion, easier access to help and many other functionalities which are not available in the vanilla Python interpreter.&lt;br /&gt;
&lt;br /&gt;
Let us first see how to start the &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt; interpreter. First open the terminal, type &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt; in the terminal and hit enter.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Point to the version information with mouse &amp;lt;nowiki&amp;gt;Point to the In[1]: prompt with mouse &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;After getting some information about the version of Python installed and some help commands, we get a prompt with In[1]:. But, if you get an error saying 'ipython is not installed' then refer to the tutorial on how to install the packages.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Type Ctrl-D.&lt;br /&gt;
| Now, lets see how we can quit the ipython interpreter, press Ctrl-D.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Press y and hit enter. &lt;br /&gt;
| A prompt will appear to confirm whether you really want to exit, type y to say yes and quit ipython and n to say no if you don't want to quit the ipython. Press y.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  ipython&lt;br /&gt;
| Now since we have quit the interpretor, let us start it again by typing &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  1+2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Point at the Out[1] prompt &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| And now let's see, how to use the interpreter.&lt;br /&gt;
&lt;br /&gt;
Start with the simplest thing, addition.&lt;br /&gt;
&lt;br /&gt;
type 1+2 at the prompt. IPython promptly gives back the output as 3. Notice that the output is displayed with an &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;Out[1]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; indication.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  5 - 3&lt;br /&gt;
 7 - 4&lt;br /&gt;
 6 * 5&lt;br /&gt;
| Let us now try few more operations such as, 5 minus 3, 7 minus 4, 6 into 5.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Use the up arrow key to go back to the command &amp;lt;tt&amp;gt;1+2&amp;lt;/tt&amp;gt; Use left arrow to navigate to start of line Type&lt;br /&gt;
&lt;br /&gt;
 print&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;Hit Enter. Point at the Out[] prompt &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Now let's see how the ipython remembers the history of commands. For example &amp;lt;tt&amp;gt;print 1+2&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Instead of typing the whole thing,use the up arrow key to go back to the command &amp;lt;tt&amp;gt;1+2&amp;lt;/tt&amp;gt; which we did before, now use the left-arrow key to navigate to the beginning of the line and type the word``print``and press space. We have changed the line to print 1+2, now press enter. The interpreter prints the result as 3. Please note that the indication Out square brackets is not shown here.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Change from &amp;lt;tt&amp;gt;print 1+2&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;print 10*2&amp;lt;/tt&amp;gt; &lt;br /&gt;
| Now let us do print 10 into 2. We use the up arrow key to navigate to the previous command 1+2. Now change &amp;lt;tt&amp;gt;1 plus 2&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;10 into 2&amp;lt;/tt&amp;gt; and press enter.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;nowiki&amp;gt;ro&amp;lt;tab&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Till now, we saw how to invoke the ipython interpreter,quit the ipython and navigate through previous commands in ipython. Now, let's see, what is tab-completion?. let's take an example, suppose we want to use the function &amp;lt;tt&amp;gt;round&amp;lt;/tt&amp;gt;. For this we just type &amp;lt;tt&amp;gt;ro&amp;lt;/tt&amp;gt; at the prompt and press the tab key.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Stay on the terminal &lt;br /&gt;
| As you can see on the terminal, IPython completes the command &amp;lt;tt&amp;gt;ro&amp;lt;/tt&amp;gt; into round, This feature of ipython is called the tab-completion.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;nowiki&amp;gt;r&amp;lt;tab&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Let's see some more possibilities of tab completion just type &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; and then press the tab.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Stay on the terminal &lt;br /&gt;
| As you can see that IPython does not complete the command. This is because, there are many possibilities of &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; therefore it just lists out all the possible completions of r.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 3&lt;br /&gt;
&lt;br /&gt;
Assignment 1 &lt;br /&gt;
| Now let's try out an exercise. Pause the video,solve the problem and resume the video.&lt;br /&gt;
&lt;br /&gt;
# find out the commands starting with &amp;quot;ab&amp;quot;?&lt;br /&gt;
# list out the commands starting with &amp;quot;a&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;nowiki&amp;gt;ab&amp;lt;tab&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;a&amp;lt;tab&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Switch to the terminal for solution. &amp;lt;tt&amp;gt;ab&amp;lt;/tt&amp;gt; tab completes to &amp;lt;tt&amp;gt;abs&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;a&amp;lt;tab&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; gives us a list of all the commands starting with a.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  abs?&lt;br /&gt;
| Now, let's see what the functions abs is used for. We will use the help features of ipython to find out this. To see the documentation of a function, type the function name followed by a exercise mark. Ipython interpreter will show the documentation for the function. et us see the documentation of the function abs, type abs? and press enter&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  abs(-19)&lt;br /&gt;
 abs(19)&lt;br /&gt;
| As the documentation says, &amp;lt;tt&amp;gt;abs&amp;lt;/tt&amp;gt; accepts a number as an input and returns it's absolute value.&lt;br /&gt;
&lt;br /&gt;
lets see few examples,&lt;br /&gt;
&lt;br /&gt;
Type abs(-19) and abs(19) on the interpreter.&lt;br /&gt;
&lt;br /&gt;
We get 19, as expected, in both the cases.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  abs(-10.5)&lt;br /&gt;
| Now lets try it for decimal numbers; lets try abs(-10.5), we got 10.5 as the result.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 4&lt;br /&gt;
&lt;br /&gt;
Assignment 2 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 round?&lt;br /&gt;
| Pause the video here, try out the following exercise and resume the video.&lt;br /&gt;
&lt;br /&gt;
Look-up the documentation of &amp;lt;tt&amp;gt;round&amp;lt;/tt&amp;gt; and see how to use it.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| Switch to the terminal for solution. And you can look up the documentation of the function round by typing round exercise mark in the ipython interpreter.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Highlight the syntax with mouse hover on terminal &lt;br /&gt;
| If you notice, there are extra square brackets around &amp;lt;tt&amp;gt;ndigits&amp;lt;/tt&amp;gt;. This means that &amp;lt;tt&amp;gt;ndigits&amp;lt;/tt&amp;gt; is optional and 0 is the default value. Optional parameters are shown in square brackets in Python documentation.&lt;br /&gt;
&lt;br /&gt;
The function &amp;lt;tt&amp;gt;round&amp;lt;/tt&amp;gt;, rounds a number to a given precision.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 5&lt;br /&gt;
&lt;br /&gt;
Assignment 3 &lt;br /&gt;
| Pause the video here, try out the following exercise and resume the video. et us now try few more examples with the function round.&lt;br /&gt;
&lt;br /&gt;
Check the output of round(2.48) round(2.48, 1) round(2.48, 2) round(2.484) round(2.484, 1) round(2.484, 2)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 6&lt;br /&gt;
&lt;br /&gt;
Solution 3 &lt;br /&gt;
| We get 2.0, 2.5 and 2.48, which are what we expect.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Switch to terminal &lt;br /&gt;
&lt;br /&gt;
 round(2.484&lt;br /&gt;
&lt;br /&gt;
Hit Enter &lt;br /&gt;
| Let's now see how to correct typing errors which we often make while typing at the terminal. As already shown, if we haven't hit the enter key already, we could navigate using the arrow keys and make deletions using delete or backspace key and correct the errors.&lt;br /&gt;
&lt;br /&gt;
let us make a typing error deliberately, type&lt;br /&gt;
&lt;br /&gt;
round(2.484&lt;br /&gt;
&lt;br /&gt;
and hit enter, without closing the parenthesis.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Point at the prompt with three dots &lt;br /&gt;
&lt;br /&gt;
 )&lt;br /&gt;
| We get a prompt with dots. This prompt is the continuation prompt of &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt;. It appears when, the previous line is incomplete. now complete the command of the same examples with close parenthesis and press enter. We got the expected output that is 2.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;&amp;lt;Type any big random number&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 round(35.488762320&lt;br /&gt;
 Ctrl-C&lt;br /&gt;
| In other instances, if we commit a typing error with a longer and more complex expression and end up with the continuation prompt, we can type Ctrl-C to interrupt the command and to get back to the &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt; input prompt.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 7&lt;br /&gt;
&lt;br /&gt;
Assignment 4 &lt;br /&gt;
| Pause the video here, try out the following exercise and resume the video.&lt;br /&gt;
&lt;br /&gt;
# type round(2.484, and press enter. and then cancel the command using Ctrl-C.&lt;br /&gt;
# type the command, round(2.484, 2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show the solution on terminal &lt;br /&gt;
&lt;br /&gt;
 round(2.484&lt;br /&gt;
 ^C&lt;br /&gt;
 &lt;br /&gt;
 round(2.484, 2)&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 8 &lt;br /&gt;
&lt;br /&gt;
Summary slide &lt;br /&gt;
| This brings us to the end of this tutorial. In this tutorial,we have learnt to,&lt;br /&gt;
&lt;br /&gt;
# Invoke the &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt; interpreter by typing ipython.&lt;br /&gt;
# Quit the &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt;&amp;lt;nowiki&amp;gt; interpreter by using &amp;lt;ctrl&amp;gt;d.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
# Navigate in the history of &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt; by using the arrow keys.&lt;br /&gt;
# Use the tab-completion feature for writing python functions.&lt;br /&gt;
# See the documentation of functions using exercise mark.&lt;br /&gt;
# &amp;lt;nowiki&amp;gt;Interrupt using &amp;lt;ctrl&amp;gt;c when we make an error.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 9 &lt;br /&gt;
&lt;br /&gt;
Self assessment questions slide &lt;br /&gt;
| Here are some self assessment questions for you to solve&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;tt&amp;gt;'''ipython&amp;lt;/tt&amp;gt; is a programming language similar to Python.'''&amp;lt;br/&amp;gt; True or False&lt;br /&gt;
# Which key combination quits &amp;lt;tt&amp;gt;ipython&amp;lt;/tt&amp;gt;?&lt;br /&gt;
** Ctrl + C&lt;br /&gt;
** Ctrl + D&lt;br /&gt;
** Alt + C&lt;br /&gt;
** Alt + D&lt;br /&gt;
# Which character is used at the end of a command, in Ipython to display the documentation.&lt;br /&gt;
** under score (_)&lt;br /&gt;
** exercise mark (?)&lt;br /&gt;
** exclamation mark (!)&lt;br /&gt;
** ampersand (&amp;amp;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 10 &lt;br /&gt;
&lt;br /&gt;
Solution of self assessment questions on slide &lt;br /&gt;
| And the answers,&lt;br /&gt;
&lt;br /&gt;
# Ipython is not a programming language, it is just an interpreter.&lt;br /&gt;
# We use Ctrl D to quit Ipython interpreter.&lt;br /&gt;
# We use ? at the end of the function name to display its documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Show slide 11&lt;br /&gt;
&lt;br /&gt;
Acknowledgment slide &lt;br /&gt;
| Hope you have enjoyed this tutorial and found it useful. Thank you!&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Chandrika</name></author>	</entry>

	</feed>