gpt4 book ai didi

ipython - 设置 iPython 默认配置文件

转载 作者:行者123 更新时间:2023-12-05 05:26:06 36 4
gpt4 key购买 nike

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

$ ipython profile create

然后,我创建了另一个,这次我给它起了名字testing:

$ ipython profile create testing

我已经根据自己的喜好自定义了这个测试配置文件(提示和自动加载扩展等),现在我希望它成为我的默认配置文件,所以它在我输入时启动:

$ ipython

我知道我可以开始:

$ ipython --profile=testing

但这需要大量的输入。

我已经尝试编辑 profile_default 文件夹中的文件 ipython_config.py第 89 行:

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

但它不起作用。任何想法为什么?它坏了吗?

编辑:由于我必须在数周或两周的时间段内使用不同的配置文件,因此我正在寻找一种方法来为这些时间段选择默认配置文件。从 IPython 本身实现这一点会很棒,与此同时,一个非常方便的解决方法是在 bash 配置中添加一个别名(正如 cel 在其中一个评论):

alias ipython='ipython --profile=testing'

最佳答案

profile_default 进行备份,然后将 profile_testing 重命名为 profile_default

或者你可以将profile_testing的内容复制到profile_default

关于ipython - 设置 iPython 默认配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28253864/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com