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 - Command Line Options
In this chapter, let us understand how to work with various command pne options in IPython.
Invoking IPython Program
You can invoke an IPython program using the following options −
C:python36> ipython [subcommand] [options] [-c cmd | -m mod | file] [--] [arg]
The file option is a Python script with .py extension. If no other option is given, the script is executed and command prompt reappears.
C:python36>ipython hello.py Hello IPython welcome to interactive computing
Subcommands and Parameters
An IPython command accepts the following subcommand options −
Profile − Create and manage IPython profiles.
Kernel − Start a kernel without an attached frontend.
Locate − Print the path to the IPython dir.
History − Manage the IPython history database.
An IPython profile subcommand accepts the following parameters −
ipython profile create myprofile − Creates a new profile.
ipython profile pst − Lists all available profiles.
ipython locate profile myprofile − Locates required profile.
To install new IPython kernel, use the following command −
Ipython kernel –install –name
To print the path to the IPython dir, use the following command −
C:python36>ipython locate myprofile C:Usersacer.ipython
Besides, we know that −
The history subcommand manages IPython history database.
The trim option reduces the IPython history database to the last 1000 entries.
The clear option deletes all entries.
Some of the other important command pne options of IPython are psted below −
Sr.No. | IPython Command & Description |
---|---|
1 | --automagic Turn on the auto calpng of magic commands. |
2 | --pdb Enable auto calpng the pdb debugger after every exception. |
3 | --pylab Pre-load matplotpb and numpy for interactive use with the default matplotpb backend. |
4 | --matplotpb Configure matplotpb for interactive use with the default matplotpb backend. |
5 | --gui=options Enable GUI event loop integration with any of ( glut , gtk , gtk2 , gtk3 , osx , pyglet , qt , qt4 , qt5 , tk , wx , gtk2 , qt4 ). |
The sample usage of some of the IPython command pne options are shown in following table −
Sr.No. | IPython Command & Description |
---|---|
1 | ipython --matplotpb enable matplotpb integration |
2 | ipython --matplotpb=qt enable matplotpb integration with qt4 backend |
3 | ipython --profile=myprofile start with profile foo |
4 | ipython profile create myprofile create profile foo w/ default config files |
5 | ipython help profile show the help for the profile subcmd |
6 | ipython locate print the path to the IPython directory |
7 | ipython locate profile myprofile print the path to the directory for profile `myprofile` |