设置iPython默认配置文件

设置iPython默认配置文件,ipython,Ipython,安装IPython后,我立即创建了一个默认配置文件: $ ipython profile create 然后,我创建了另一个,这次我给它命名为测试: $ ipython profile create testing # The IPython profile to use. c.TerminalIPythonApp.profile = 'testing' 我已根据自己的喜好定制了此测试配置文件(提示、自动加载扩展等),现在我希望它成为我的默认配置文件,因此在我键入以下内容时开始: $ ip

安装IPython后,我立即创建了一个默认配置文件

$ ipython profile create
然后,我创建了另一个,这次我给它命名为测试

$ ipython profile create testing
# The IPython profile to use.
c.TerminalIPythonApp.profile = 'testing'
我已根据自己的喜好定制了此测试配置文件(提示、自动加载扩展等),现在我希望它成为我的默认配置文件,因此在我键入以下内容时开始:

$ ipython
我知道我可以从以下几点开始:

$ ipython --profile=testing
但这需要大量的打字

我已经尝试过编辑
profile\u default
文件夹第89行中的文件
ipython\u config.py

$ ipython profile create testing
# The IPython profile to use.
c.TerminalIPythonApp.profile = 'testing'
但它不起作用。你知道为什么吗?它坏了吗

编辑:由于我必须在几周或两周的时间段内使用不同的配置文件,因此我正在寻找一种方法,为这些时间段选择默认配置文件。同时,从IPython本身,一个非常方便的解决方法是在bash配置中添加一个别名(正如cel在其中一条评论中指出的那样),这将是非常了不起的:


备份
profile\u default
,然后将
profile\u testing
重命名为
profile\u default


或者,您可以将
profile\u testing
的内容复制到
profile\u default

谢谢,这是一个简单的解决方法,但我想了解的是如何在每次启动会话时告诉iPyth我想要启动的默认配置文件。想象一下,每当我想设置默认配置文件时,我必须复制和重命名文件夹,在我的情况下,每隔两周就会发生一次。你意识到用
$IPython--profile=testing
启动IPython会更简单,对吧?我不需要经常创建概要文件。我只是使用history在指定所需配置文件的情况下运行long命令,这通常是击键次数较少,然后键入
ipython
。您还可以为
ipython--profile=testing
@cel设置shell别名,这是另一种解决方法,但非常方便,事实上我现在正在使用它。谢谢你,赛尔。