ipython / ipython/ipython

Unable to set profile for embedded shell

オープン
#11,462 コメント 0 件 リアクション 4 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
16.8k
フォーク
4.5k
平均マージ
1日 2時間
マージ済み PR(30日)
6

説明

I'm trying to use an embedded IPython shell for a simple program.

I want to use a custom profile for the program to have it's own history and possibly other options.

Looking into https://ipython.readthedocs.io/en/stable/interactive/reference.html#embedding and
https://ipython.readthedocs.io/en/stable/config/options/terminal.html, i came up with:

```python
from IPython.terminal.embed import InteractiveShellEmbed
from traitlets.config.loader import Config

cfg = Config()
cfg.BaseIPythonApplication.profile = 'my_new_profile'
cfg.BaseIPythonApplication.auto_create = True
cfg.BaseIPythonApplication.copy_config_files = True

shell = InteractiveShellEmbed(config=cfg, banner1='Custom IPython shell')
shell()
print(shell.profile)
```

However, this still uses the `default` profile and has all my normal ipython history.

What am I doing wrong?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。