Guest User

Untitled

a guest
Jun 6th, 2020
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data