Difference between :pyf % and :!python % for running python code

Viewed 1152

I use to map F9 to :pyf % to run python files from vim. But after reading this answer, which suggests

nnoremap <buffer> <F9> :exec '!python' shellescape(@%, 1)<cr>

Just wondering which approach should be preferred for running python code from vim session.

2 Answers
Related