These are chat archives for ipython/ipython

10th
Aug 2015
Kyle Kelley
@rgbkrk
Aug 10 2015 15:35
I'm not sure we have a way to do that right now.
Would be nice though.
Min RK
@minrk
Aug 10 2015 17:36
You can use TerminalInteractiveShell.display_page = True to make pager calls regular display calls, which go in the cell output area.
Matthew Rocklin
@mrocklin
Aug 10 2015 17:48

Quick question about printing things in the Jupyter notebook. I want to have a progress bar during a computation. This runs by dumping things to sys.stdout in a separate thread. It looks like the notebook suppresses sys.stdout during execution of an individual cell. No worries, I'll just include an explicit call to flush. Now I get this sometimes:

Exception in thread Thread-17:
Traceback (most recent call last):
  File "/home/mrocklin/Software/anaconda/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/home/mrocklin/Software/anaconda/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/mrocklin/workspace/dask/dask/diagnostics/progress.py", line 67, in _timer_func
    self._update_bar()
  File "/home/mrocklin/workspace/dask/dask/diagnostics/progress.py", line 77, in _update_bar
    sys.stdout.write(msg)
  File "/home/mrocklin/Software/anaconda/lib/python2.7/site-packages/IPython/kernel/zmq/iostream.py", line 216, in write
    self._buffer.write(string)
ValueError: I/O operation on closed file

Is there a better way to accomplish what I want?

Or should I just ignore this error internally?
(which is fine with me)
Matthew Rocklin
@mrocklin
Aug 10 2015 18:04
nm, worked around
Min RK
@minrk
Aug 10 2015 18:12
That's super weird, I don't think I've seen the closed file before.
Ironically, it might be a threadsafety issue with our threadsafety protection.
Ariel Rokem
@arokem
Aug 10 2015 23:21
Screen Shot 2015-08-06 at 10.40.26 AM.png
Anyone else see something like this?
Matthias Bussonnier
@Carreau
Aug 10 2015 23:21
A long time ago yes.
Should be fixed on recent chrome (was a chrome bug)
Ariel Rokem
@arokem
Aug 10 2015 23:22
Gotcha. Thanks!