ipython

Jump to next code cell (IPython notebook)

三世轮回 提交于 2019-12-24 05:22:10
问题 I use the IPython 2.0 Notebook for teaching. The notebooks are created before the teaching session, and used as-is during the session. Sure, when I prepare the notebook, it has sense that I access all the cells in sequence (actually, I don't). Back in class, while I present the concepts and the code to the students, I don't need the focus to be put on the next cell, I just need the cursor to wait in the next code cell... The best I can hope is that someone has been able to change the default

IPython GUI event loop exception hook

强颜欢笑 提交于 2019-12-24 05:12:21
问题 Is it possible to get notification of exceptions that accure during IPythons internal GUI-Event-Loop? Here is an example where an exception is raised but not displayed to the user. minimal.py: from PyQt4 import QtCore, QtGui class TestDialog(QtGui.QDialog): def __init__(self): QtGui.QDialog.__init__(self) self.timer = QtCore.QTimer() self.timer.timeout.connect(self.timeout) self.timer.start(1000) self.show() def timeout(self): print "before exception" raise Exception("Do you see me?") print

IPython GUI event loop exception hook

前提是你 提交于 2019-12-24 05:12:09
问题 Is it possible to get notification of exceptions that accure during IPythons internal GUI-Event-Loop? Here is an example where an exception is raised but not displayed to the user. minimal.py: from PyQt4 import QtCore, QtGui class TestDialog(QtGui.QDialog): def __init__(self): QtGui.QDialog.__init__(self) self.timer = QtCore.QTimer() self.timer.timeout.connect(self.timeout) self.timer.start(1000) self.show() def timeout(self): print "before exception" raise Exception("Do you see me?") print

IPython GUI event loop exception hook

浪尽此生 提交于 2019-12-24 05:12:03
问题 Is it possible to get notification of exceptions that accure during IPythons internal GUI-Event-Loop? Here is an example where an exception is raised but not displayed to the user. minimal.py: from PyQt4 import QtCore, QtGui class TestDialog(QtGui.QDialog): def __init__(self): QtGui.QDialog.__init__(self) self.timer = QtCore.QTimer() self.timer.timeout.connect(self.timeout) self.timer.start(1000) self.show() def timeout(self): print "before exception" raise Exception("Do you see me?") print

igraph plot function does not show images in an IPython notebook

若如初见. 提交于 2019-12-24 02:44:17
问题 I try to do a basic igraph plotting in an IPython notebook: fn = 'misrables.gml' gr = igraph.Graph.Read_GML(fn) igraph.plot(gr) instead of seeing a graph I see this: Out[7]: <igraph.drawing.Plot at 0x1120d6978> How do I persuade IPython to actually show the graphics? Some clarifications Inline matplotlib works fine, so this is not the issue. I have cairo installed: import cairo cairo.version output: 1.10.0 Calling _repr_svg() on the plot object results in an error: TypeError Traceback (most

ipython: OperationalError: disk I/O error

回眸只為那壹抹淺笑 提交于 2019-12-24 02:12:47
问题 I was running ipython successfully on fedora 18 until now: I'm getting the following exception when trying to launch it: Traceback (most recent call last): File "/usr/bin/ipython", line 9, in <module> load_entry_point('ipython==1.1.0', 'console_scripts', 'ipython')() File "/usr/lib/python2.7/site-packages/IPython/__init__.py", line 118, in start_ipython return launch_new_instance(argv=argv, **kwargs) File "/usr/lib/python2.7/site-packages/IPython/config/application.py", line 544, in launch

Package load error in anaconda and Spyder

依然范特西╮ 提交于 2019-12-24 01:54:54
问题 I have three python 2.7 files edit in Spyder 3.1.4 in Anaconda 4.3.1 (1). TestClass.py :Just define a class import numpy as np class TestClass: def getArray(self): return np.zeros((3,4)); (2). a1.py from TestClass import *; tt=TestClass(); (3). a2.py #just a empty python file When I "runfile" "a1.py" in Spyder, a TestClass instance tt was created, and I run following code in Spyder's IPython console: tt.getArray() Out[9]: array([[ 0., 0., 0., 0.], [ 0., 0., 0., 0.], [ 0., 0., 0., 0.]]) It

scripting ipython through django's shell_plus

前提是你 提交于 2019-12-24 01:01:55
问题 I'm writing a shell script which runs a command through ipython with the -c option like this: ipython -c "from blah import myfunct; myfunct()" but I want to invoke ipython through django's shell_plus command so I can take advantage of all the stuff shell_plus automatically loads for me: $ ./manage.py shell_plus I can't just add "-c ..." to the end of that because manage.py doesn't know what to do with it. Is there any way to pipe the -c option somehow? 回答1: There are a couple of ways to do

What does the '[notebook]' in 'pip install ipython[notebook]' mean?

天大地大妈咪最大 提交于 2019-12-24 00:56:28
问题 The '[notebook]' appears to be some kind of modifier, but as I was installing Jupyter rather than ipython I suddenly wondered what other variants of this modifier I've been missing out on, perhaps something that would install specific kernels or configurations for me. Unfortunately, I don't know what the '[notebook]' is: pip search '[notebook]' finds nothing, and I don't know what this modifier is or is called. I've looked at the PyPI naming convention pep, etc, but I couldn't find anything

Hide SQL statements when running IPython notebook with Django's django-extensions

无人久伴 提交于 2019-12-24 00:47:28
问题 I'm using Django's django-extensions to run an iPython notebook with access to the Django models (as detailed here http://andrewbrookins.com/python/using-ipython-notebook-with-django/). When I make model queries, the notebook shows the underlying SQL queries executed by Django, like so: Can I hide this SQL? It's so voluminous it makes the display unusable at times. 回答1: with recent version, you could use %%capture variable the code to capture stdout and stderr into a variable adding the --no