1
0

execute external commands

This commit is contained in:
Deven Blake 2021-05-30 17:25:45 -04:00
parent fbd72dcd70
commit 40ef42a246
2 changed files with 15 additions and 0 deletions

11
it/!.py Normal file
View File

@ -0,0 +1,11 @@
import subprocess
def main(buffer, command):
if len(command) == 1:
print("?")
else:
try:
print("[%d]" % subprocess.run(command[1:]).returncode)
except Exception as err:
print("%s" % str(err))
return buffer

View File

@ -9,6 +9,10 @@ For disambiguation it's suggested that this project be referred to as "ited", pr
## Included commands ## Included commands
### !
Passes arguments to Python `subprocess.run`.
### buffer ### buffer
This is where code relating to the Buffer class is kept but calling this from within the editor will allow you to view the current buffer's attributes. This is where code relating to the Buffer class is kept but calling this from within the editor will allow you to view the current buffer's attributes.