Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- proc = subprocess.Popen(['ls','/etc'],stdout=subprocess.PIPE)
- while True:
- line = proc.stdout.readline()
- if not line:
- break
- # byte to str + strip whitespaces
- line = line.decode("utf-8").strip()
- print( line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement