小编Var*_*nga的帖子

在 Jupyter 笔记本中,如何将自动缩进更改为制表符而不是 4 个空格

我刚开始使用 jupyter notebook。谷歌搜索没有帮助。谢谢!

更新:答案的快速摘要

在启动 ipython 文件之前在单元格中运行以下代码为我完成了任务。一个问题是我们必须每次都为每个文件运行它。

    %%javascript

    // 将设置应用到所有当前 CodeMirror 实例
    IPython.notebook.get_cells().map(
        function(c) { return c.code_mirror.options.indentWithTabs=true; }
    );

    // 确保将来创建的新 CodeMirror 实例也使用此设置
    CodeMirror.defaults.indentWithTabs=true;

ipython jupyter jupyter-notebook

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

ipython ×1

jupyter ×1

jupyter-notebook ×1