You can do it using os
with os.system
function. The function will write any output to stdout
.
import os
path_to_folder = "."
os.system(f'''icacls "{path_to_folder}"''')
If you want to have a call that returns output of the command as a string use:
import subprocess
path_to_folder = "."
output = subprocess.check_output(["icacls", path_to_folder])
print(output)
Keep in mind, obviously icacls
is a windows tool, on linux the command would look different (ls -la
maybe).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…