From b5412b56dabf35e9ddcd791ca4c81eb4ce1f42f2 Mon Sep 17 00:00:00 2001 From: Brian Auron Date: Sun, 5 Jul 2020 08:24:10 -0700 Subject: [PATCH] Fixing 'Pythonic way' to 1) actually exit vim 2) everywhere. Addresses [issue #82](https://github.com/hakluke/how-to-exit-vim/issues/82) --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ab4e1de..c3dce9d 100644 --- a/README.md +++ b/README.md @@ -46,11 +46,10 @@ python -c "from os import system; system('killall -9 vim')" ```` ## The pythonic way -Credit: @hakluke +Credit: @Resisty ```python -:py3 import os,signal;from subprocess import check_output;os.kill(int(check_output(["pidof","vim"]).decode -('utf-8')),signal.SIGTERM) +:py3 import os,signal;from subprocess import check_output;[os.kill(int(i),signal.SIGTERM) for i in check_output(['pgrep', 'vim']).strip().decode('utf-8').split('\n')] ``` ## The pure perl way