import subprocess resp = subprocess.check_output(["ls", "/bin"]).decode().split() print(*resp, sep="\n")