gpt4 book ai didi

Python:正确的 Emacs header ?

转载 作者:行者123 更新时间:2023-11-28 01:49:44 25 4
gpt4 key购买 nike

如果我有一个 python 文件,我想让 emacs 在 python 模式下打开,我应该在那个 .py 文件的顶部放什么?

例如,如果它是一个 .h 文件,我希望 emacs 在 C++ 模式下打开它,我会输入:

//===-------------------------------*- C++ -*-===//

Python 的等价物是什么?

最佳答案

如果你有一个 .py 文件,Emacs 应该已经知道用Python 主要模式。否则,看 this .

如果出于任何原因你需要明确说明,你可以指定 file variables在评论中文件的顶部;例如:

# -*- mode: python -*-

关于Python:正确的 Emacs header ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43453633/

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