Changes between Version 4 and Version 5 of ChimeraPythonStyle
- Timestamp:
- Feb 2, 2011, 11:26:06 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ChimeraPythonStyle
v4 v5 14 14 }}} 15 15 16 Another way to code a style is to add a style note to the top of each file, e.g.:16 It's possible to insert a mode line into each file to override user editor settings. The first line of the file might contain something like this (which should work for both emacs and vim): 17 17 {{{ 18 # -*- coding: utf-8; mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=python:et:sw=4:ts=4:sts=4 18 # -*- coding: utf-8; mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=python:et:sw=4:ts=4:sts=4:fdm=indent:fo+=croql 19 19 }}} 20 20 21 For emacs, here's a good blog on useful python tools: http://jasonmbaker.com/7-tools-for-working-with-python-in-emacs-and. 22 23 It's possible to insert a mode line into each file to override user editor settings. The first line of the file might contain something like this (which should work for both emacs and vim): 21 Note that the encoding (coding) is utf-8 here, which is recommended for python 3.x, but earlier versions are recommended to use ISO-8859-1, so the PEP8 recommends a mode line like this: 24 22 {{{ 25 23 # -*- coding: ISO-8859-1; mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=ISO-8859-1:ft=python:et:sw=4:ts=4:sts=4 26 24 }}} 27 25 26 For emacs, here's an interesting blog on useful python tools: http://jasonmbaker.com/7-tools-for-working-with-python-in-emacs-and. 27 28 == [http://www.python.org/dev/peps/pep-0008/ PEP8 Snippets] == 29 28 30 {{{ 29 ### BEGIN PEP8 snippet:30 31 Indentation 31 32 … … 57 58 UTF-8 is preferred over Latin-1, see PEP 3120. 58 59 59 60 ### END PEP8 snippet:61 60 }}}
![[Chimera Issue Tracking System]](/trac/chimera/chrome/site/chimera_logo.png)