开发者

What is the use of strings like "-*- Mode: Python -*-" found at the top of some python files?

Here are the top few lines (all comments) from a python application. What do开发者_开发问答 the first two comment lines indicate? Are they special markers for another app?

# -*- Mode: Python -*-

# vi:si:et:sw=4:sts=4:ts=4

#

# Istanbul - A desktop recorder

# Copyright (C) 2005 Zaheer Abbas Merali (zaheerabbas at merali dot org)

# Portions Copyright (C) 2004,2005 Fluendo, S.L. (www.fluendo.com).

# All rights reserved.


The first line is an emacs thing (although it may also be a vi thing). It basically tells it that it should use python-mode to read the file. You'll usually see this if the file ends in an extension other than .py.

As mentioned, the second line deals with spacings.


Its define tab size 4 spaces to text editors like vi

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜