Python: IPython和Python区别Python: IPython和Python区别Python: IPython和Python区别Python: IPython和Python区别
  • 首页
  • 博客
  • 文件
  • 书签
  • 分析
  • 登录
Search
Generic filters

Python: IPython和Python区别

Published by admin at 2022年7月3日
Categories
  • Python
Tags
Installation

This sections will guide you through installing IPython itself, and installing kernels for Jupyter if you wish to work with multiple version of Python, or multiple environments.
Quick install reminder

Here is a quick reminder of the commands needed for installation if you are already familiar with IPython and are just searching to refresh your memory:

Install IPython:

$ pip install ipython

Install and register an IPython kernel with Jupyter:

$ python -m pip install ipykernel

$ python -m ipykernel install [--user] [--name ] [--display-name <"User Friendly Name">]

for more help see

$ python -m ipykernel install  --help
ipython介绍
IPython 是一个 python 的交互式 shell,比默认的python shell 好用得多,支持变量自动补全,自动缩进,支持 bash shell命令,内置了许多很有用的功能和函数。
IPython 是基于BSD 开源的。
IPython 为交互式计算提供了一个丰富的架构,包含:
强大的交互式 shell
Jupyter 内核
交互式的数据可视化工具
灵活、可嵌入的解释器
易于使用,高性能的并行计算工具
IPython的开发者吸收了标准解释器的基本概念,在此基础上进行了大量的改进,创造出一个令人惊奇的工具。在它的主页上是这么说的:“这是一个增强的交互式Pythonshell。”具有tab补全,对象自省,强大的历史机制,内嵌的源代码编辑,集成Python调试器,%run机制,宏,创建多个环境以及调用系统shell的能力。
IPython与标准Python的最大区别在于,Ipython会对命令提示符的每一行进行编号。
python shell与ipython的区别:
python shell不能在退出保存历史;
ipython历史记录自动保存:
保存在history.sqlite文件下:
可用“_”、“__”、“___”调用最近三次记录;
Python客栈送红包、纸质书
python shell不支持tab自动补全;
ipython支持tab补全;
python shell不能快速获取类、函数信息;
ipython通过“?”显示对象签名、文档字符串、代码位置,通过“??”显示源代码;
python shell不能直接执行shell命令,需要借助sys;
ipython通过“!”调用系统命令,如“!uptime”;
(5) 其他
ipython有很多magic函数,可通过使用%lsmagic枚举;
%run:运行python文件
%edit:使用编辑器打开当前函数编辑
%save:把某些历史记录保存到文件
%debug:激活debug程序
%timeit:获得程序执行时间
%paste:获取剪切板文件并执行,最好用%cpaste,可通过Ctrl+C中断

发表回复 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Categories

  • 猫
  • Python
  • MySQL
  • Django
  • Html/CSS
  • JavaScript
  • Vue
  • RegExp
  • php
  • Practice
  • Virtualization
  • Linux
  • Windows
  • Android
  • NAS
  • Software
  • Hardware
  • Network
  • Router
  • Office
  • WordPress
  • SEO
  • English
  • Games
  • Recipes
  • living
  • Memorandum
  • Essays
  • 未分类

归档

©2015-2022 Alaica Blog support@alaica.com