'How to disable code formatting in ipython?
IPython has this new feature that reformats my prompt. Unfortunately, it is really buggy, so I want to disable it. I managed to do it when starting IPython from the command line by adding the following line in my ipython_config.py:
c.TerminalInteractiveShell.autoformatter = None
However, it does not work when I run it from a python script. I start IPython from my script the following way:
c = traitlets.config.get_config()
c.InteractiveShellEmbed.colors = "Linux"
c.TerminalInteractiveShell.autoformatter = None
c.InteractiveShellEmbed.loop_runner = lambda coro: loop.run_until_complete(coro)
IPython.embed(display_banner='', using='asyncio', config=c)
If I change the colors value, the colors change accordingly, so the configuration itself works. However, no matter what I do with autoformatter, IPython autoformats my code regardless. What am I doing wrong?
Solution 1:[1]
Apparently, the answer is:
c.InteractiveShellEmbed.autoformatter = None
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | petersohn |
