0

I'm able to set Jupyter's QtConsole to use a plaintext widget instead of rich text by setting this

c.JupyterQtConsoleApp.plain = True

in the configuration file ~/.jupyter/jupyter_qtconsole_config.py

Spyder's IPython Console does not seem to respect the settings in this configuration file. How do I set this option (or get the same behavior) for Spyder's IPython Console?

mrclary
  • 489
  • 3
  • 16

2 Answers2

0

(Spyder maintainer here) Spyder only uses rich text widgets in its consoles, so it doesn't respect the config option you mention (although it tries to respect most of the others).

I really don't understand why you would like to use plain text widgets instead, but if you want that possibility, there's always qtconsole, as you point out.

Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124
  • My principle motivation is that the rendering of output of pint objects is poor and slow since it sends it through a LaTeX interpreter (pint is a units package). See [here](https://github.com/hgrecco/pint/issues/616) for an example. I've been using Spyder for 7+ years, since _before_ Pierre integrated QtConsole, and have no desire to change ;-). I'd like to explore other solutions. – mrclary Feb 01 '18 at 06:39
  • I don't know how to help you about that. Perhaps you could talk with Pint developers to see how to improve things for Spyder. You could ping me on Github if I can help with something else. – Carlos Cordoba Feb 01 '18 at 12:36
0

I've found a workaround for this issue which is to delete the _repr_latex_ methods defined by pint. In an __init__.py where I instantiate a unit registry to be used throughout a project I have the following:

import pint
ureg = pint.UnitRegistry()

# don't display latex in consoles
delattr(pint.quantity._Quantity, '_repr_latex_')
delattr(pint.unit._Unit, '_repr_latex_')

This should be safe since methods of the pattern _repr_<meme>_ are only used by IPython.display module.

mrclary
  • 489
  • 3
  • 16