Read content from the current buffer and run it in python. exec '!echo ' . shellescape(join(getline(1, '$'), '\n'), 1) . ' | python --'