IPython is a growing project, with increasingly language-agnostic components. IPython 3.x was the last monolithic release of IPython, containing the notebook server, qtconsole, etc. As of IPython 4.0, the language-agnostic parts of the project: the notebook format, message protocol, qtconsole, notebook web application, etc. have moved to new projects under the name Jupyter. IPython itself is focused on interactive Python, part of which is providing a Python kernel for Jupyter.
Announcements¶
IPython tends to be released on the last Friday of each month, this section updated rarely. Please have a look at the release history on PyPI.
IPython 7.12.0: Released on Jan 31st 2020.
IPython 7.11.0 and 7.11.1: Released on Dec 27, 2019 and Jan 1st 2020
IPython 7.10.0 and 7.10.1: Released on Nov 27, 2019 and Dec 1st 2019
IPython 7.9.0: Released on Oct 25, 2019
IPython 7.8.0: Released on Aug 30, 2019
IPython 7.7.0: Released on Jul 26, 2019
IPython 7.6.0 and 7.6.1: Released on June 28th, and July 3rd 2019.
IPython 7.5: fixes to issues brought by 7.4, documentation changes and other minor updates (April 25, 2019)
IPython 7.4: improvements to the completion system and miscellaneous fixes (March 21, 2019)
IPython 7.3: several bugfixes, minor improvements and Python 3.8 support (February 18, 2019)
IPython 7.2: minor bugfixes, improvements, and new configuration options (November 29, 2018)
IPython 7.1: fixes to new features, internal refactoring, and fixes for regressions (October 27, 2018)
IPython 7.0: major new features (September 27th, 2018). See the release notes for more information about what’s new.
IPython 6.5: minor bugfixes and Python 3.7 compatibility (July 28, 2018)
IPython 5.8: minor bugfixes (July 28, 2018)
IPython 6.4 and IPython 5.7: minor bugfixes (May 10, 2018)
IPython 6.3 and IPython 5.6: new features and bugfixes (April 2, 2018)
IPython 6.0: This release, the first to require Python 3, integrates the Jedi library for completion. See the release notes for more information about what’s new.
JupyterCon 2017: The first Jupyter Community Conference will take place in New York City on August 23-25 2017, along with a satellite training program on August 22-23. The Project Jupyter team has partnered with O’Reilly Media for this event; for more details, including submitting a talk, see the JupyterCon website.
IPython 5.0: The release of IPython 5.0 brings a major revision of the terminal interface, including syntax highlighting as you type and better multiline editing, thanks to the prompt_toolkit library. See the release notes for more about the new features.
Book: Cyrille Rossant has published the second edition of the IPython minibook: Learning IPython for Interactive Computing and Data Visualization, for which Damian Avila was a technical reviewer. We thank Packt Publishing for donating a portion of the proceeds from this book to support IPython’s development.
O’Reilly Book: Mining the Social Web is an open source data science project and book that features nearly 130 examples with IPython Notebook and a Vagrant-powered virtual machine environment. You can preview all of the example notebooks from its GitHub repository on IPython’s Notebook Viewer here.
Several of the authors of IPython are connected with academic and scientific research, so it is important for us to be able to show the impact of our work in other projects and fields.
If IPython contributes to a project that leads to a scientific publication, please acknowledge this fact by citing the project. You can use this ready-made citation entry.
Источник
IPython
IPython
приглашение IPython
Тип
IPython — интерактивная оболочка для языка программирования Python, которая предоставляет расширенную интроспекцию, дополнительный командный синтаксис, подсветку кода и автоматическое дополнение. Является компонентом пакета программ SciPy.
Содержание
Другие возможности
IPython позволяет осуществлять неблокирующее (англ. non-blocking ) взаимодействие с Tkinter, GTK, Qt и WX. Стандартная оболочка Python позволяет взаимодействие только с Tkinter. IPython может интерактивно управлять параллельными кластерами используя асинхронные статусы обратных вызовов и/или MPI. IPython может использоваться как замена стандартной командной оболочки операционной системы, особенно на платформе Windows, возможности оболочки которой ограничены. Поведение по умолчанию похоже на поведение оболочек UNIX подобных систем, но тот факт что работа происходит в окружении Python позволяет добиваться большей настраиваимости и гибкости.
Пресса
IPython упоминается в популярной компьютерной прессе, [1] и представлялся на научных конференциях. [2] При научной и инженерной работе часто используется вместе с библиотекой для визуализации Matplotlib [3] .
Jeremy Jones (January 27, 2005). «Enhanced Interactive Python with IPython». ONLamp.com.
Несколько презентаций IPython на научных конференциях и конференциях посвящённом Python перечислены на the Scientific Python website.
видео для начинающих по IPython
Для цитирования проекта в научных работах автор просит использовать следующую публикацию:
Fernando Pérez, Brian E. Granger IPython: A System for Interactive Scientific Computing // Computing in Science and Engineering. — 2007. — Vol. 9. — № 3. — P. 21-29. — DOI:10.1109/MCSE.2007.53
Wikimedia Foundation . 2010 .
Полезное
Смотреть что такое «IPython» в других словарях:
IPython — Desarrollador Scipy Información general Diseñador Fernando Perez … Wikipedia Español
IPython — Infobox Software name = IPython caption = author = Fernando Perez latest release version = 0.9.1 latest release date = September 14, 2008 operating system = Cross platform genre = Shell license = BSD license website =… … Wikipedia
Comparison of command shells — For more details on this topic, see Shell (computing). A command shell is a command line interface computer program to an operating system. Contents 1 General characteristics 2 Interactive features 3 Programming features … Wikipedia
Сравнение командных оболочек — Подробнее по этой теме см.: Оболочка операционной системы. Командная оболочка это компьютерная программа с интерфейсом командной строки операционной системы. Содержание 1 Общие характеристики 2 Интеракти … Википедия
NumPy — Тип расширение языка Python Разработчик Проект сообщества Операционная система Кроссплатформенное программное обеспечение Последняя версия 1.6.1 (20 июля 2011) … Википедия
Пайтон — Python Класс языка: функциональный, объектно ориентированный, императивный, аспектно ориентированный Тип исполнения: интерпретация байт кода, компиляция в MSIL, компиляция в байт код Java Появился в: 1990 г … Википедия
Read-eval-print loop — A read eval print loop (REPL), also known as an interactive toplevel, is a simple, interactive computer programming environment. The term is most usually used to refer to a Lisp interactive environment, but can be applied to command line shells… … Wikipedia
Langage Python — Python (langage) Pour les articles homonymes, voir Python. Python … Wikipédia en Français
Langage de programmation Python — Python (langage) Pour les articles homonymes, voir Python. Python … Wikipédia en Français
Langage python — Python (langage) Pour les articles homonymes, voir Python. Python … Wikipédia en Français
Источник
IPython: замена стандартного Python shell
Python shell достаточно удобная вещь для тестирования и изучения возможностей языка, кто-то даже использует его в качестве калькулятора(что между прочим весьма удобно), в этом цикле статей я бы хотел рассказать о IPython — замене стандартного Python shell’а, который предоставляет расширенный список возможностей, что делает работу с ним более эффективной.
Скачать и установить IPython можно с официального сайта
Пространство имен
Запускаем IPython shell командой ‘ipython’, как и в в стандартном Python shell’е мы можем присваивать переменным значения: In [1]: msgflag = 1
In [3]: msg = «hello»
In [4]: warning = None
Во время ввода можно пользоваться автокомплитом, например набрав msg и нажав Tab, мы получим возможные варианты: In [5]: msg msg msgflag
Если вариант один, то он автоматически появится в поле ввода.
IPython предоставлять возможность использования пространств имен, например, команда ‘who’ выводит список доступных переменных: In [5]: who msg msgflag pi warning
Она имеет ряд опций, например, чтобы вывести переменные типа int, следует написать: In [6]: who int msgflag pi
Если требуется получить дополнительную информацию о переменных, можно воспользоваться командой ‘whos’:
Так же есть возможность поиска по имени переменной, для этого нужно использовать команду ‘psearch’: In [8]: psearch msg* msg msgflag
Возможно расширить критерии поиска типом переменной, например: In [9]: psearch msg* int msgflag
Для того чтобы сохранить переменную в профайле(она будет доступна после перезапуска IPython) есть команда ‘store’: In [10]: store msgflag Stored ‘msgflag’ (int)
Так же есть возможность сохранить переменную в отдельный файл: In [11]: store msgflag > /tmp/m.txt Writing ‘msgflag’ (int) to file ‘/tmp/m.txt’.
Чтобы посмотреть сохраненные переменные, вводится команда ‘store’ без параметров: In [12]: store Stored variables and their in-db values: msgflag -> 1
Чтобы очистить текущее пространство имен, воспользуемся командой ‘reset’ и убедимся, что оно очистилось при помощи команды ‘who’: In [13]: reset Once deleted, variables cannot be recovered. Proceed (y/[n])? y
In [14]: who Interactive namespace is empty.
Можно восстановить переменные, которые были ранее сохранены при помощи команды ‘store’ и убедиться, что они восстановились командой ‘who’: In [15]: store -r
In [16]: who msgflag
Так же можно очистить все, что находится в store и при следующем старте пространство имен будет пустым: In [17]: store -z
Логгирование
Другая полезная возможность IPython — логгирование. Команда ‘logstate’ проверяет текущее состояние логгера: In [18]: logstate Logging has not been activated.
Командой ‘logstart’ можно начать логгирование: In [19]: logstart Activating auto-logging. Current session state plus future input saved. Filename : ipython_log.py Mode : rotate Output logging : False Raw input log : False Timestamping : False State : active
Лог сохраняется в текущей директории как исходный код Python Команды ‘logon’ и ‘logoff’ используются для включения/выключения логгирования: In [20]: logoff Switching logging OFF
In [21]: logon Switching logging ON
Магические команды
Команды, описанные выше в терминологии IPython называются magic commands(магические команды). Для того, чтобы посмотреть полный список magic команд, нужно ввести ‘lsmagic’: In [22]: lsmagic Available magic functions: %Exit %Pprint %Quit %alias %autocall %autoindent %automagic %bg %bookmark %cd %clear %color_info %colors %cpaste %debug %dhist %dirs %doctest_mode %ed %edit %env %exit %hist %history %logoff %logon %logstart %logstate %logstop %lsmagic %macro %magic %p %page %pdb %pdef %pdoc %pfile %pinfo %popd %profile %prun %psearch %psource %pushd %pwd %pycat %quickref %quit %r %rehash %rehashx %rep %reset %run %runlog %save %sc %store %sx %system_verbose %time %timeit %unalias %upgrade %who %who_ls %whos %xmode
Automagic is ON, % prefix NOT needed for magic functions.
Магические команды могут использовать знак процента в качестве префикса. Это полезно в случае, если имя переменной совпадает с именем команды. Для вызова помощи по всем магическим командам используется ‘magic’ команда. Для получения справки по определенный магической команды достаточно просто поставить знак вопроса в конце: In [23]: lsmagic? Type: Magic function Base Class: String Form: > Namespace: IPython internal File: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/ipython-0.9.1-py2.5.egg/IPython/Magic.py Definition: lsmagic(self, parameter_s=») Docstring: List currently available magic functions.
Для получения дополнительной информации следует ввести 2 знака вопроса в конце команды, в таком случае выводится и исходный код команды-функции.
Для переменных определенных самостоятельно, можно так же использовать знак вопроса: In [24]: msgflag? Type: int Base Class: String Form: 1 Namespace: Interactive Docstring: int(x[, base]) -> integer
Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero .
Некоторые «косметические» команды
Можно использовать ‘p’ как сокращение для ‘print’: In [25]: import sys
In [26]: p sys.path [», ‘/Library/Frameworks/Python.framework/Versions/2.5/bin’, ‘/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg’, ‘/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/bdist_mpkg-0.4.3-py2.5.egg’, ‘/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/macholib-1.1-py2.5.egg’, .
Так же можно пользоваться сокращенной формой для вызова функций: In [27]: def x(a, b): . print a, b . .
Для вызова функции можно сделать так: In [29]: def x(): print «123» .
Можно вызвать функцию, которая в качестве параметров принимает строки, без необходимости заключать их в кавычки: In [31]: def x(a,b): print «%s-%s» % (a, b) .
In [32]: , x astr bstr ——-> x(«astr», «bstr») astr-bstr
Интроспекция
Если вы забыли какие аргументы нужны для вызова функции или метода, вы всегда можете узнать это при помощи команды ‘pdef’: In [37]: import re
In [38]: pdef re.match re.match(pattern, string, flags=0)
Так же можно посмотреть документацию по этой функции: In [39]: pdoc re.match Class Docstring: Try to apply the pattern at the start of the string, returning a match object, or None if no match was found. Calling Docstring: x.__call__(. ) x(. )
Всю информацию о функции можно посмотреть при помощи команды ‘pinfo’: In [40]: pinfo re.match Type: function Base Class: String Form: Namespace: Interactive File: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/re.py Definition: re.match(pattern, string, flags=0) Docstring: Try to apply the pattern at the start of the string, returning a match object, or None if no match was found.
Вы так же можете посмотреть исходный код функции: In [41]: psource re.match def match(pattern, string, flags=0): «»»Try to apply the pattern at the start of the string, returning a match object, or None if no match was found.»»» return _compile(pattern, flags).match(string)
Если вы хотите посмотреть исходный код файла, в котором определен тот или иной объект, используйте команду ‘pfile’: In [42]: pfile re.match
Так же можно запустить ваш любимый редактор для редактирования файла, в котором определен тот или иной объект: In [43]: edit -x re.match Editing.
Ссылки на источники
PS: На этом пока все, если эта тема кому-то интересна, то в следующих статьях продолжу описание возможностей IPython.