【Python】选择ipython替代python的理由
来源:互联网 发布:中世纪2优化9兵种 编辑:程序博客网 时间:2024/05/16 06:26
登陆linux环境,已安装Anaconda,最常用的就是输入“python”,进入python环境。偶然看到师弟用ipython进入环境,好奇查询了以下区别。
python shell与ipython的区别:
(1) python shell不能在退出保存历史;
ipython历史记录自动保存:
保存在history.sqlite文件下:
可用“_”、“__”、“___”调用最近三次记录;
(2) python shell不支持tab自动补全;
ipython支持tab补全;
(3) python shell不能快速获取类、函数信息;
ipython通过“?”显示对象签名、文档字符串、代码位置,通过“??”显示源代码;
(4) python shell不能直接执行shell命令,需要借助sys;
ipython通过“!”调用系统命令,如“!uptime”;
(5) 其他
ipython有很多magic函数,可通过使用%lsmagic枚举;
%run:运行python文件
%edit:使用编辑器打开当前函数编辑
%save:把某些历史记录保存到文件
%debug:激活debug程序
%timeit:获得程序执行时间
%paste:获取剪切板文件并执行,最好用%cpaste,可通过Ctrl+C中断
ipython有很多快捷键
ipython的扩展宏系统
storemagic持久化宏、变量、别名;
autoreload自动重载;
参考资料
(简单版)https://www.zhihu.com/question/51467397?from=profile_question_card
(全面版)https://www.cnblogs.com/zzhzhao/p/5295476.html
- 【Python】选择ipython替代python的理由
- 选择Python的理由
- 选择Python的理由
- 选择python的理由?
- Python----ipython
- 使用Python的理由
- 学习python的利器-ipython
- 强大的Python Shell:IPython
- 学习python的利器-ipython
- 【python】IPython Notebok的使用
- ipython与python的区别
- Ipython:交互式的Python命令行
- Python要self的理由
- Python要self的理由
- ipython 最好用的交互python环境
- Python之IPython
- Python---ipython特性
- python,ipython,wxPython安装
- 简单背包问题
- Prism框架(三)——基于模块的应用程序开发
- 编译,反编译,混淆,【一】
- 我在学校网站一页面上无意间发现了一个漏洞
- 大数据学习2——大数据处理架构Hadoop概述
- 【Python】选择ipython替代python的理由
- 【Scikit-Learn 中文文档】无监督学习: 寻求数据表示
- 获取Excel sheet页中实际有效行数(不是我写的,但是也不是我转载的)
- Java中使用Jedis操作Redis
- 中间件kingshard入门(四):jmeter压测出现的问题too many open files
- vue加载时闪现模板的解决方法(例如加载数据之前出现item.name)
- 自定义View画五角星
- mt6735 CTS Google issue of android.holo
- MyBatis的Mapper接口以及Example的实例函数及详解