2009-04-17
■ setup.py : 自分で標準的に使っている内容

# -*- coding: utf-8 -*- from distutils.core import setup import os import py2exe py2exe_options = { 'compressed' : 1, 'optimize' : 2, 'bundle_files' : 2 } setup( options = { 'py2exe': py2exe_options }, windows = [ { 'script' : r'test.py' } ], data_files = [ ('', [ 'ReadMe.txt' ] ) ], zipfile = None )
- test.py はプログラム実行ファイル
- ReadMe.txt が入っているのは dist/ 以下にコピーするファイルを記述する箇所
■ [vim] vim の ftplugin/python.vim への追記内容

setl fileencoding=utf-8 " file encoding setl autoindent " 自動インデント setl textwidth=80 " 文字数/行 "setl smartindent " 高度なインデントを行う "smartindent より cindent の処理の方が厳密 setl cinwords=if,elif,else,for,while,try,except,finally,def,class setl tabstop=4 " タブ幅 setl expandtab " タブ入力時にスペースで置換する setl shiftwidth=4 " インデントの各段階に使われる空白の数 setl softtabstop=4 " <Tab>, <BS>を使用して編集する際の<Tab>の対応する空白の数 setl smarttab " 行頭で<Tab>を押した時に shiftwidth に対応して空白を挿入する nmap <C-l> >> nmap <C-h> << imap <C-l> <ESC>>>A imap <C-l> <ESC><<A imap <C-w> <ESC><C-w> setl makeprg=python\ -c\ \"import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')\" setl efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m command! Python call s:Python() nmap <F5> :Python<CR> function! s:Python() :w :!python % endfunction command! PyChecker call s:PyChecker() nmap <F4> :PyChecker<CR> function! s:PyChecker() :w :!pyChecker % endfunction
コメント
トラックバック - http://python.g.hatena.ne.jp/nelnal_programing/20090417