ipython

Update PyQt widget through ipython/jupyter notebook cells

若如初见. 提交于 2019-12-09 19:00:25
问题 I have an annoying issue that I have not been able to solve for the past few months. Basically, I'm using jupyter/ipython notebook to call pyqt and display 3d geometric data. This is how I initialize the app into an object and after I add some polygons and points, I call show(): class Figure(object): ''' Main API functions ''' def __init__(self): print "... initializing canvas ..." self.app = QApplication(sys.argv) self.app.processEvents() ... def show(self): #Show self.GUI = GLWindow(data)

Python的安装及文件类型、变量

倖福魔咒の 提交于 2019-12-09 17:46:47
一、为什么学习python 服务于大数据、人工智能、自动化运维。 简单易学 代码简洁 薪资高 近几年越来越火 二、Python的安装 linux 系统默认安装, CentOS7 默认安装了python2.7 安装ipython yum install -y epel-release yum install -y python-pip pip install ipython==5.3.0 进入ipython windows 系统中下载软件,安装环境变量,测试启动。 下载地址: https://www.python.org/downloads/windows/ windows中工具pycharm中的快捷键 alt + shift +f10 执行 ctrl + / 注释 ctrl + d 复制上行生成一行或多行 ctrl + c 复制一行 ctrl + x 剪切 ctrl + v 粘贴 ctrl + a 全选 .ctrl + shift + n :在多文件中项目中快速查找文件 ctrl + alt + l: ctrl+a 选中,ctrl + alt + l 快速调整格式。 alt + shift 看虚拟处错误,处理 sys.argv[0] 参数设置 sys.argv[1] 参数设置 alt +回车 点中虚线 自动import tab 光绪行后走 shift + tab 光标行前走

Anaconda: Python 3 and 2 in IPython/Jupyter Notebook

不羁的心 提交于 2019-12-09 16:28:30
问题 I have a Python 3 installation of Anaconda and want to be able to switch quickly between python2 and 3 kernels. This is on OSX. My steps so far involved: conda create -p ~/anaconda/envs/python2 python=2.7 source activate python2 conda install ipython ipython kernelspec install-self source deactivate After this I have a python2 Kernel to choose from in the python3 IPython notebook, which however can't start. So I went ahead and modified /usr/local/share/jupyter/kernels/python2/kernel.json {

ipython notebook - $DISPLAY variable error [duplicate]

瘦欲@ 提交于 2019-12-09 16:17:47
问题 This question already has an answer here : ipython notebook on linux VM running matplotlib interactive with nbagg (1 answer) Closed 3 years ago . I am running IPython notebook on an ubuntu vm. Everything works great so far, except I'm unable to do interactive matplotlib plots. The error I get is: TclError: no display name and no $DISPLAY environment variable And I'm just trying to follow these super basic tutorials. http://nbviewer.ipython.org/github/jakevdp/matplotlib_pydata2013/tree/master

IPython with bpython features [closed]

孤街浪徒 提交于 2019-12-09 16:09:53
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I really admire bpython with its nice coloring and autocomplete, autohint and so on. The problem is, there are some features in IPython which I can't do without, for example, reload, magic commands, matplotlib interacting, the shell interaction, the Vim interaction or the IPython

Multiple incompatible subclass instances of InteractiveShellEmbed are being created

社会主义新天地 提交于 2019-12-09 15:57:09
问题 If I install the Anaconda Python Distribution and try to run ipython manage.py shell from within my django app, the error below is thrown. I know that when I install anaconda, it comes packaged with python and ipython whose version differs from the other python/ipython versions I have. But irrespective of the ipython version, why should the django shell throw an error? I tried uninstalling the system ipython and the same error gets thrown, which implies that there is some issue with the

python: ignoring leading “>>>” and “…” in interactive mode?

天大地大妈咪最大 提交于 2019-12-09 15:46:55
问题 Many online python examples show interactive python sessions with normal leading ">>>" and "..." characters before each line. Often, there's no way to copy this code without also getting these prefixes. In these cases, if I want to re-paste this code into my own python interpreter after copying, I have to do some work to first strip off those prefixes. Does anyone know of a way to get python or iPython (or any other python interpreter) to automatically ignore leading ">>>" and "..."

IPython notebook: How to connect to existing kernel?

◇◆丶佛笑我妖孽 提交于 2019-12-09 15:17:51
问题 I am able to connect two ipython console session to one kernel by: $ ipython console In [1]: %connect_info { ... Content of JSON with info for connecting ... } Paste the above JSON into a file, and connect with: $> ipython <app> --existing <file> or, if you are local, you can connect with just: $> ipython <app> --existing kernel-43204.json or even just: $> ipython <app> --existing if this is the most recent IPython session you have started. And accordingly I can substitute the <app> by

Line-wrapping problems with IPython shell

 ̄綄美尐妖づ 提交于 2019-12-09 14:32:44
问题 If I have run a long line in IPython, and try and recall it (using the up-arrow) or backspace beyond the start of the current line, it displays incorrectly (all smushed into one line) For example, in the following session I wrote a long line [1] , entered a somewhat-blank line [2] , then up-arrowed twice to get the print statement on line [3] , and the following happened: Happens in both iTerm and Terminal.app.. I had a similar problem with regular terminal sessions, which was fixed by

How to load a CSV into IPython notebook

血红的双手。 提交于 2019-12-09 13:46:25
问题 I have a csv file ready to load into my python code, however, I want to load it into the following format: data = [[A,B,C,D], [A,B,C,D], [A,B,C,D], ] How would I go about loading a .csv file that is readable as a numpy array? e.g., simply using previous tutorials plays havoc with using: data = np.array(data) Failing that, I would just like to upload my csv file (e.g. 'dual-Cored.csv' as data = dual-Cored.csv) 回答1: The simplest solution is just: import numpy as np data = np.loadtxt("myfile.csv