ipython

Create language kernels for IPython for a language without ZeroMQ bindings

岁酱吖の 提交于 2020-03-18 17:12:24
问题 There are some interesting descriptions of writing language kernels to allow a language previously unsupported by IPython to be executed from IPython. In all cases, the kernel creation step involves using the target language's ZeroMQ bindings (since ZeroMQ is a major architectural component of IPython's front-end to kernel communication protocol). In my company, a proprietary language was created a few years ago and is maintained with compilers to bytecode (with a bytecode runner written in C

Python二三事 - 接触Python(x,y)

余生颓废 提交于 2020-03-18 11:52:27
注释:本文原来转自博客大巴的一篇文章,向原作者致谢!我也做了相应的修改,更加完善对于Pythonx,y的介绍 Python 二三事   面向初学者介绍Python相关的一些工具,以及可能遇到的常见问题。 更新1st 2011.1.15 更新2nd 2012.3.4 引言 在这里我假设你已经看完了一篇Python教程,基本熟悉了Python的结构和语法,在命令行下的Python互动环境中尝试过大部分Python的语句,觉得Python是个不错的语言准备继续下去。那么本篇文章会就Python实际运用中相关工具的选择,包括IDE,调试套件,第三方库管理工具这些进行介绍。另外还会对某些中文环境下容易遇到的问题,例如unicode编码解码的问题进行说明。本文主要是针对 Windows 环境下的 Python 开发进行说明。文章的目的是为了分享些我觉得很有用的经验和例子,若发现文中有疏漏之处请务必联系我。谢谢。 Python 语言介绍 Python 是一个近些年在开始流行起来的计算机编程语言。根据 Python官网 上的简介,Python主要特性包括跨平台,免费,简单且容易维护。就我个人理解来说,Python是一门适合大部分人的语言,因为各种类型的第三方库都有,所以像简单桌面程序,动态网站开发,图像处理,表格处理,甚至自动发帖机这些小应用在简单的学习后

Where is the history file for ipython

人盡茶涼 提交于 2020-03-18 03:08:14
问题 I can not determine where the ipython is storing its history. a. There is no ~/.pythonhistory: 12:49:00/dashboards $ll ~/.py* ls: /Users/steve/.py*: No such file or directory b. Nothing special in the python startup file: 12:49:07/dashboards $echo $PYTHONSTARTUP /shared/.pythonstartup 12:49:43/dashboards $cat /shared/.pythonstartup import rlcompleter import readline readline.parse_and_bind("tab: complete") c. BUT: i do have plenty of history available in ipython when I start it up. So where

printing bold, colored, etc., text in ipython qtconsole

倖福魔咒の 提交于 2020-03-17 04:30:12
问题 I'm trying to get text to display as bold, or in colors, or possibly in italics, in ipython's qtconsole. I found this link: How do I print bold text in Python?, and used the first and second answers, but in qtconsole, only the underlining option works. I try: print '\033[1m' + 'Hello World!' + '\033[0m' And get: Hello World! (No boldface). The colors don't work either. But: print '\033[4m' + 'Hello World!' + '\033[0m' And get: Hello World! With underlining. This is only in the qtconsole.

Why does pip need an exclamation point to use in iPython?

最后都变了- 提交于 2020-03-14 16:00:50
问题 Just a quick example, typing pip list doesn't work but !pip list does. Is there some syntax regarding the exclamation point and using modules in the ipython shell? 回答1: This is actually not specific to pip , but really any shell assignment from the iPython notebook. You'll notice other shell commands also work (from the docs): In[1]: !pwd /User/home/ Change directory: In[1]: !cd /var/etc This is simply shorthand that the good folks at Jupyter have included. See Shell Assignment in the docs

Why does pip need an exclamation point to use in iPython?

梦想与她 提交于 2020-03-14 15:58:21
问题 Just a quick example, typing pip list doesn't work but !pip list does. Is there some syntax regarding the exclamation point and using modules in the ipython shell? 回答1: This is actually not specific to pip , but really any shell assignment from the iPython notebook. You'll notice other shell commands also work (from the docs): In[1]: !pwd /User/home/ Change directory: In[1]: !cd /var/etc This is simply shorthand that the good folks at Jupyter have included. See Shell Assignment in the docs

利用Python进行数据分析:【IPython】

こ雲淡風輕ζ 提交于 2020-03-14 04:36:24
一、IPython基础功能 1、IPython是交互式的Python命令行 2、安装与使用 1 #安装:pip install ipython 2 #使用:ipython与Python解释器的使用方法一致 注:之后想学习机器学习的读者强烈建议安装Anaconda(含有numpy、pandas等等等) 二、IPython高级功能 1、基本使用 #- TAB键自动完成 #- ?:内省、命名空间搜索 #- !:执行系统命令 #- 丰富的快捷键 2、魔术命令:以%开始的命令 # %run:执行文件代码 # %paste:执行剪贴板代码 # %timeit:评估运行时间 # %pdb:自动调试 3、IPython Notebook #使用命令历史 #获取输入输出结果 #目录标签系统 #IPython Notebook ################# #In [28]: 3+2 #Out[28]: 5 #In [29]: _ #Out[29]: 5 #In [30]: __ #Out[30]: 5 #In [31]: ___ #Out[31]: 5 4、安装jupyter #pip install jupyter 三、IPython快捷键 四、IPython常用的魔法命令 五、IPython调试器命令 来源: https://www.cnblogs.com/liwei1153300111

Python的变量和简单的数据类型

故事扮演 提交于 2020-03-12 07:10:33
IPython介绍 ipython 是一个 python 的交互式 shell ,比默认的 python shell 好用得多,支持变量自动补全,自动缩进,支持 bash shell 命令,内置了许多很有用的功能和函数。学习 ipython 将会让我们以一种更高的效率来使用 python 。同时它也是利用Python进行科学计算和交互可视化的一个最佳的平台 IPython提供了两个主要的组件: 一个强大的python交互式shell 供Jupyter notebooks使用的一个Jupyter内核(IPython notebook) IPython的主要功能如下: 运行ipython控制台 使用ipython作为系统shell 使用历史输入(history) Tab补全 使用 %run 命令运行脚本 使用 %timeit 命令快速测量时间 使用 %pdb 命令快速debug 使用 pylab 进行交互计算 使用IPython Notebook 安装IPython ipython支持Python2.7版本或者3.3以上的版本,我用的是windows下的python 3.8.2版本。 安装ipython很简单,可以直接使用pip管理工具即可: C:\Users\Admin>pip3 install ipython 下载太慢可以使用国内镜像: C:\Users\Admin>pip3

在IPython中重新加载子模块

独自空忆成欢 提交于 2020-03-10 16:35:53
目前,我正在处理一个包含子模块并使用numpy / scipy的python项目。 Ipython用作交互式控制台。 不幸的是,我对现在使用的工作流程不是很满意,请多多指教。 在IPython中,框架是通过简单的 import 命令加载的。 但是,通常有必要在框架的子模块之一中更改代码。 至此,已经加载了一个模型,并且我使用IPython与之交互。 现在,该框架包含许多相互依赖的模块,即,在最初加载框架时,主模块正在导入和配置子模块。 仅当使用 reload(main_mod.sub_mod) 重新 reload(main_mod.sub_mod) 模块时,才执行对代码的更改。 这很麻烦,因为我需要使用完整路径分别重新加载所有更改的模块。 如果 reload(main_module) 也重新加载所有子模块,但不重新加载numpy / scipy,那将是非常方便的。 #1楼 由于某些原因,当您 将代码从一个笔记本导入到另一个笔记本 时, %autoreload 和 dreload 似乎都不适合这种情况。 仅纯Python reload 有效: reload(module) 基于 [1] 。 #2楼 另外一个选项: $ cat << EOF > ~/.ipython/profile_default/startup/50-autoreload.ipy %load_ext

PIP 安装ipython报错

妖精的绣舞 提交于 2020-03-06 09:09:16
按照教程安装完python并且配置好环境检验存在,但是在用指令pip install ipython[all] 安装ipython时报出了以下错误: 不知道有什么解决办法呢? 来源: CSDN 作者: asjoker1 链接: https://blog.csdn.net/asjoker1/article/details/104612986