W MacVim, zapisać następujący kod jako test.pyJak skonfigurować Syntastic jak python3 sprawdzający zamiast python2
print "Hello world! python2"
, który jest najwyraźniej źle z python3, ale po biegnę: W celu zapisania pliku nie ma za to komunikat o błędzie, Poniżej znajduje się część ~/.vimrc, która jest o Syntastic:
" Syntastic
"" Recommended settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
"" Display checker-name for that error-message
let g:syntastic_aggregate_errors = 1
"" I use the brew to install flake8
let g:syntastic_python_checkers=['flake8', 'python3']
jak Syntastic wykryć ten rodzaj błędu jak biegnę test.py w Terminalu :
NingGW:Desktop ninggw$ python3 test.py
File "test.py", line 1
print "Hello world! python2"
^
SyntaxError: Missing parentheses in call to 'print'
Oto co: SyntasticInfo powiedział:
Syntastic version: 3.8.0-10 (Vim 800, Darwin, GUI)
Info for filetype: python
Global mode: active
Filetype python is active
The current file will be checked automatically
Available checkers: flake8 python
Currently enabled checker: flake8
Press ENTER or type command to continue
Która instalacja Pythona Czy Twój 'flake8' należą? Myślę, że to jest klucz. –