IPython
- IPython - Magic Commands
- IPython - Embedding IPython
- Importing Python Shell Code
- Setting IPython as Default Python Environment
- IPython - IO Caching
- Dynamic Object Introspection
- IPython - Command Line Options
- IPython - System Commands
- IPython - History Command
- Running & Editing Python Script
- IPython - Getting Started
- IPython - Installation
- IPython - Introduction
Jupyter
- Jupyter Notebook - IPyWidgets
- Converting Notebooks
- Jupyter Notebook - Plotting
- Cell Magic Functions
- Jupyter Notebook - Markdown Cells
- Jupyter Notebook - Editing
- Jupyter Notebook - Types of Cells
- Jupyter Notebook - User Interface
- Jupyter Notebook - Dashboard
- Installation and Getting Started
- Working With Jupyter Online
- Jupyter Notebook - Introduction
- Project Jupyter - Overview
QtConsole
- Using github and nbviewer
- Connecting to Jupyter Notebook
- QtConsole - Multiple Consoles
- QtConsole - Save to Html
- QtConsole - Inline Graphics
- QtConsole - Multiline Editing
- QtConsole - Getting Started
JupyterLab
- JupyterLab - Installing R Kernel
- JupyterLab - Interface
- Installation & Getting Started
- JupyterLab - Overview
Jupyter Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
IPython - Getting Started
This chapter will explain how to get started with working on IPython.
Starting IPython from Command Prompt.
Before proceeding to understand about IPython in depth, note that instead of the regular >>>, you will notice two major Python prompts as explained below −
In[1] appears before any input expression.
Out[1] appears before the Output appears.
Besides, the numbers in the square brackets are incremented automatically. Observe the following screenshot for a better understanding −
Now, if you have installed Anaconda distribution of Python, open Anaconda prompt from start menu.
Start IPython from conda prompt
When compared to regular Python console, we can notice a difference. The IPython shell shows syntax highpghting by using different colour scheme for different elements pke expression, function, variable etc.
Another useful enhancement is tab completion. We know that each object has one or more methods available as defined in its class. IPython pops up appropriate pst of methods as you press tab key after dot in front of object.
In the following example, a string is defined. As a response, the methods of string class are shown.
IPython provides information of any object by putting ‘?’ in front of it. It includes docstring, function definitions and constructor details of class. For example to explore the string object var defined above, in the input prompt enter var?. The result will show all information about it. Observe the screenshot given below for a better understanding −
Magic Functions
IPython’s in-built magic functions are extremely powerful. There are two types of magic functions.
Line magics, which work very much pke DOS commands.
Cell magics, which work on multiple pnes of code.
We shall learn about pne magic functions and cell magic functions in detail in subsequent chapters.
Advertisements