En MacVim, je sauve le code suivant comme test.pyComment configurer Syntastic comme vérificateur python3 au lieu de python2
print "Hello world! python2"
, qui est apparemment mal à python3, mais après avoir exécuté: w pour enregistrer le fichier , il n'y a pas de message d'erreur pour elle, Suite est une partie de ~/.vimrc, ce qui est tout au sujet 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']
Comment faire Syntastic détecter ce type d'erreur que je lance test.py dans le Terminal :
NingGW:Desktop ninggw$ python3 test.py
File "test.py", line 1
print "Hello world! python2"
^
SyntaxError: Missing parentheses in call to 'print'
Voici ce que: SyntasticInfo dit:
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
quelle installation Python Votre 'flake8' appartenir? Je pense que c'est la clé. –