Advertisement
Guest User

Untitled

a guest
Jun 6th, 2020
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. import subprocess
  2.  
  3. proc = subprocess.Popen(['ls','/etc'],stdout=subprocess.PIPE)
  4. while True:
  5.   line = proc.stdout.readline()
  6.   if not line:
  7.     break
  8.   #  byte to str + strip whitespaces
  9.   line = line.decode("utf-8").strip()
  10.   print( line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement