How to call an external command in Python

1 Answer

0 votes
import subprocess

subprocess.run(["ls", "-l"])




'''
run:

total 4
-rw-r--r-- 1 root root 72 May 28 07:39 test.py

'''

 



answered May 28, 2021 by avibootz

Related questions

...