【问题标题】:How can I turn off color in ipdb?如何在 ipdb 中关闭颜色?
【发布时间】:2017-12-14 20:38:10
【问题描述】:

当我在 python 脚本中嵌入代码时

import ipdb; ipdb.set_trace() 

颜色与默认 Xterm 配色方案冲突

【问题讨论】:

    标签: ipdb


    【解决方案1】:

    旧答案 - 将其插入代码(2019,不起作用):

    import ipdb; ipdb.def_colors='NoColor'; ipdb.set_trace()
    

    根据latest IPython更新答案

    1 - 在提示符下运行以创建默认配置文件:

    ipython profile create
    

    2 - 编辑/你的主目录/.ipython/profile_default/ipython_config.py

    在顶部添加

    c = get_config()
    

    然后添加

    c.InteractiveShell.colors = 'NoColor'
    

    【讨论】:

    • @user3673,我已经更新了答案以反映 ipython 的变化
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-14
    • 2014-09-27
    • 2017-10-04
    相关资源
    最近更新 更多