Ask coding questions

← Back to all posts
check_output
m1tchapa100za

Modify the following code so that it runs correctly, by changing the
first argument of check_outputonly

import subprocess

output = subprocess.check_output("cat /etc/passwd").decode('utf-8')
print(output)

output = subprocess.check_output(["grep", "root", "/etc/passwd"], shell=True).decode('utf-8')
print(output)

Voters
ktmdb
m1tchapa100za