intellij-community icon indicating copy to clipboard operation
intellij-community copied to clipboard

PY-14631 Use IPython config file in Python Console

Open msoxzw opened this issue 5 years ago • 5 comments

@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?

msoxzw avatar Dec 13 '19 07:12 msoxzw

Thank you @msoxzw! I'll pass a build to our QAs for testing!

Elizaveta239 avatar Dec 13 '19 15:12 Elizaveta239

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?

Elizaveta239 avatar Dec 17 '19 13:12 Elizaveta239

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

msoxzw avatar Dec 17 '19 14:12 msoxzw

Launch a normal IPython:

import IPython
IPython.start_ipython()

Launch a embedded IPython:

import IPython
IPython.embed()

msoxzw avatar Dec 17 '19 15:12 msoxzw

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

Elizaveta239 avatar Dec 18 '19 17:12 Elizaveta239