This commit is contained in:
Brian Auron 2022-04-22 21:15:02 -04:00 committed by GitHub
commit 2af6c7bf9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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