Setting iPython default profile

ぃ、小莉子 提交于 2020-01-05 10:07:07

问题


Right after installing IPython, I created a default profile with:

$ ipython profile create

Then, I created another one, this time I gave it the name testing:

$ ipython profile create testing

I have customized this testing profile (the prompt, and autoreload extension, etc) to my liking, and now I would like it to be my default profile, so it's started when I type:

$ ipython

I know that I can start it with:

$ ipython --profile=testing

But that is a lot of typing.

I have already tried editing the file ipython_config.py in the profile_default folder, line 89:

# The IPython profile to use.
c.TerminalIPythonApp.profile = 'testing'

But it's not working. Any ideas why? Is it broken?

EDIT: Since I have to use different profiles for periods of time of weeks or fortnights, I'm looking for a way of selecting a default profile for those periods of time. It would be awesome achieving that from IPython itself, in the meantime, a very convenient workaround is adding an alias in the bash configuration(as pointed out by cel in one of the comments):

alias ipython='ipython --profile=testing'

回答1:


Take a backup of profile_default and then rename profile_testing to profile_default.

Or you can copy the contents of profile_testing to profile_default.



来源:https://stackoverflow.com/questions/28253864/setting-ipython-default-profile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!