saidimu apale
saidimu apale

Reputation: 1039

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.

Upvotes: 2

Views: 1149

Answers (2)

Jason Baker
Jason Baker

Reputation: 198727

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.

Upvotes: 4

YOU
YOU

Reputation: 123881

Its define tab size 4 spaces to text editors like vi

Upvotes: 2

Related Questions