intellij-community
intellij-community copied to clipboard
PY-14631 Use IPython config file in Python Console
@Elizaveta239 I seem to solve the problem Could you help me examine if this PR indeed makes PyCharm load IPython config flie and possibly break other things?
Thank you @msoxzw! I'll pass a build to our QAs for testing!
Hi @msoxzw! Could you please elaborate a bit, which config parameters became supported after the fix? It looks like, for example, c.InteractiveShellApp.exec_lines
isn't supported yet.
Which of them did you use for testing?
The IPython integrated into PyCharm inherits the TerminalInteractiveShell
:
https://github.com/JetBrains/intellij-community/blob/29b41da382e03cc65fd8b5b038f113b796a22c16/python/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py#L117
It is akin to Embedding IPython, so the configuration which applies to Embedding IPython will also apply to this PR. Simply put, this config containing App keyword may be ignored just like Embedding IPython.
There is a method to set all the configuration: Running IPython from Python, but it will cause severe issues.
By the way, the only option I use is c.HistoryManager.hist_file = ':memory:'
. You could try the options without 'App' word, e.g. c.InteractiveShell.banner1
, c.TerminalInteractiveShell.banner1
Launch a normal IPython:
import IPython
IPython.start_ipython()
Launch a embedded IPython:
import IPython
IPython.embed()
Ok, I got it! If it fixes at least some use cases, it's already better than the previous version. I've created a separate issue for mentioned use cases, you can follow it on YouTrack: https://youtrack.jetbrains.com/issue/PY-39795