Here's the steps I follow to execute python code from Vim:
- I write a python source code using Vim
- I execute it via
:w !python
and I'd like a shorter way to execute the code, so I searched the Internet for a shortcut key such as this map:
autocmd FileType python nnoremap <buffer> <F9> :exec '!python' shellescape(@%, 1)<cr>
and added it to the _vimrc file. But when I hit F9, the following error message appears:
Here is the relevant text in the image above:
python: can't open file ''D:/py2.py'': [Errno 22] Invalid argument
shell returned 2.
I have already searched the Internet, but I have not got any result.
I use gVim 8.0 in Windows 10, if that helps.
